Gallery, mosaic


Install
npx shadcn add https://ui.klarhimmel.com/r/gallery-mosaic.jsonDetailsAbout, usage, props and more
Photos edge to edge with no gaps on a three-column grid, one and two columns wide in turn, so each pair of rows reads as a mosaic. Stacked full width on a phone.
Import
Import
- gallery/mosaic
- Category
- A grid of images with captions. New project? Set it up once: /get-started/installation.
Notes
When to use it
Photos edge to edge with no gaps on a three column grid, one and two columns wide in turn, so each pair of rows reads as a mosaic. Use gallery-grid for captions.
Writing for it
- Choose photographs that crop well to both a single and a double width, since the layout decides which is which. - Write the section label for assistive tech as what the photos show, because it is read aloud and never drawn. - Use a number of photos that fills whole rows, so the last row has no gap.
Watch out for
On a wide screen the second and third of every four are two columns wide, and on a phone they stack at full width. Portrait photographs crop hard in the wide slots.
Pairs well with
Usage
The block in a page, with its default content (long lists shortened). Every prop is in the table below.
Props
The type, default and text limit of every prop. On a real page, over-limit text is kept and checkSections flags it (Installation, Check a page before you ship); this live preview shows the default until it fits. The panel above edits all props.
| Prop | Type | Default | Description |
|---|---|---|---|
label | string | 'Name what the photos show' | Text, up to 48 characters. |
photos | Media[] | 4 items | List of 4 to 8. |