Media Gallery displays a responsive grid of images or videos adapted for desktop, tablet, and mobile breakpoints with RTL support.
Loading demo: media-gallery-real-world
npx sdaia-ui@latest add media-gallery
import { MediaGallery } from '@/components/ui/MediaGallery';<MediaGallery breakpoint="desktop" />Media gallery in a multi-column desktop layout.
Loading demo: media-gallery-desktop
Media gallery adapted for tablet screen sizes.
Loading demo: media-gallery-tablet
Media gallery in a single-column mobile layout.
Loading demo: media-gallery-mobile
Props for the MediaGallery component.
Prop | Type | Default | Required |
|---|---|---|---|
toolbar | boolean | true | optional |
searchValue | string | - | optional |
onSearchChange | (value: string) => void | - | optional |
searchPlaceholder | string | 'Search' | optional |
emptySearchLabel | string | 'No results found' | optional |
activeView | 'list' | 'grid' | - | optional |
onViewChange | (view: MediaGalleryView) => void | - | optional |
onFilterClick | () => void | - | optional |
onDeleteClick | (selectedImages: MediaGalleryImage[]) => void | - | optional |
onExportClick | (selectedImages: MediaGalleryImage[]) => void | - | optional |
exportLabel | string | 'Export' | optional |
onAddClick | () => void | - | optional |
addLabel | string | 'Add' | optional |
onMoreClick | () => void | - | optional |
images | MediaGalleryImage[] | [] | optional |
pagination | boolean | true | optional |
currentPage | number | 1 | optional |
totalPages | number | 1 | optional |
onPageChange | (page: number) => void | - | optional |
rtl | boolean | false | optional |
dir | "ltr" | "rtl" | — | optional |
labels | Partial<MediaGalleryLabels> | English strings | 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) | Five-column grid with the full toolbar (search, view toggle and actions) when the gallery is at least 1000px wide. |
| Tablet (768–1279px) | Three columns from 600px of gallery width. Below 1000px the toolbar becomes search, a filter button and a more (…) menu. |
| Phone (under 768px) | Two columns below 600px, with the compact toolbar. The layout follows the width of the gallery, not of the screen; pagination always uses its compact layout. |