screens/DSMediaGallery
DSMediaGallery
screensResponsive photo/video grid with a full-screen viewer, pinch-to-zoom, and swipe-to-dismiss. Supports lazy loading.
iOS 17+
Purpose
Profile photo grids, product image galleries, and in-app media browsers.
Interactive Reference
Live showroom
Need the full visual surface?
Screenshots do not scale well across every component, state, and variant. For the real interactive reference, import the package and launch DSShowcaseRoot().
Best for exploring:
variants, states, categories, and real app examples in one place.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| itemsreq | [DSMediaItem] | โ | Array of image/video URLs with thumbnails. |
| columns | Int | 3 | Grid columns. |
| spacing | CGFloat | 2 | Gap between cells (tight by default). |
| onSelect | ((DSMediaItem) -> Void)? | nil | Called when a cell is tapped. |
| showVideoBadge | Bool | true | Shows a play icon badge on video items. |
Examples
Profile photo grid
Instagram-style 3-column grid.
swift
DSMediaGallery(
items: viewModel.userPosts.map { $0.thumbnailItem },
columns: 3,
spacing: 2
) { item in
navigate(.postDetail(item.id))
}