# Image
URL: /docs/ui/image
Display image message parts with preview, loading states, and fullscreen dialog.
import { ImageSample } from "@/components/docs/samples/image";
Getting Started \[#getting-started]
Add image \[#add-image]
Use in your application \[#use-in-your-application]
Pass `Image` to `MessagePrimitive.Parts`:
```tsx title="/components/assistant-ui/thread.tsx" {1,8}
import { Image } from "@/components/assistant-ui/image";
const AssistantMessage: FC = () => {
return (
);
};
```
Variants \[#variants]
Use the `variant` prop to change the visual style.
```tsx
// Border (default)
// No border
// Background fill
```
Sizes \[#sizes]
Use the `size` prop to control the maximum width.
```tsx
// max-w-64 (256px)
// max-w-96 (384px)
// max-w-[512px]
// w-full
```
API Reference \[#api-reference]
Composable API \[#composable-api]
The component exports composable sub-components:
```tsx
import {
Image,
ImageRoot,
ImagePreview,
ImageFilename,
ImageZoom,
} from "@/components/assistant-ui/image";
photo.jpg
```
| Component | Description |
| ---------------- | --------------------------------------------------------- |
| `Image` | Default export, renders complete image part |
| `Image.Root` | Container with variant and size styling |
| `Image.Preview` | Image container with loading/error states |
| `Image.Filename` | Optional filename display below image |
| `Image.Zoom` | Medium-style zoom overlay (click to expand, ESC to close) |
Related Components \[#related-components]
* [Attachment](/docs/ui/attachment) - File attachments in composer and messages
* [File](/docs/ui/file) - Non-image file message parts