Image Viewer renders images in standard or overlay modes with desktop and mobile breakpoints and RTL support.
Loading demo: image-viewer-real-world
npx sdaia-ui@latest add image-viewer
import { ImageViewer } from '@/components/ui/ImageViewer';<ImageViewer type="standard" mobile={false} />Full-featured image viewer with navigation controls.
Loading demo: image-viewer-standard
Image viewer displayed as a fullscreen overlay on top of the page.
Loading demo: image-viewer-overlay
Image viewer optimised for mobile screens with touch-friendly controls.
Loading demo: image-viewer-mobile
Props for the Image Viewer (MediaViewer) component.
Prop | Type | Default | Required |
|---|---|---|---|
src | string | — | optional |
alt | string | — | optional |
filename | string | — | optional |
size | 'sm' | 'md' | 'lg' | 'lg' | optional |
checked | boolean | — | optional |
onCheckedChange | (checked: boolean) => void | — | optional |
onDelete | () => void | — | optional |
onPreview | () => void | — | optional |
previewLabel | string | 'Preview' | optional |
forceHover | boolean | false | optional |
How this component behaves at the three system breakpoints. Spacing and type tokens switch automatically at 768px and 1280px.
| Screen | Behavior |
|---|---|
| Desktop (1280px and up) | Opens over a dark full-screen backdrop, with arrows beside the image and a zoom bar. Use contained to show it inline in a container instead. |
| Tablet (768–1279px) | Same layout as desktop, with the tablet token values. |
| Phone (under 768px) | The image scales to fit the space left between the arrows and recalculates when the screen is resized. Long file names are truncated. |