shadcn.io is not affiliated with official shadcn/ui
Re-lead Mosaic Gallery Block for React Aria
A dense mosaic of nine drawn quilt patterns on shared hairlines, eight squares and one lead two cells wide and two tall, with a Lead control that moves the big square while the rest reflow.
Installation
Overview
A dense mosaic for React with React Aria. A centred header with a "Lead" control sits over nine drawn quilt patterns on shared hairlines that run rail to rail and end the block: eight squares and one lead that spans two columns and two rows, packed with grid-auto-flow: dense. Choose picture 1, 3 or 5 as the lead and the big square moves while the others flow around it with no gap, since the cells add up to whole rows (six columns by two rows from md, three by four on a phone). Every square carries its number, the lead shows its name, and a polite line names the lead. The patterns are drawn in the theme's greys, never photographed. It's built from Guides and Toggle Group. For pattern shops, lookbooks and any set with one hero among equals.
FAQ
Why can the lead be only picture 1, 3 or 5?
With six columns and two rows, a two-by-two lead has to start before the first row is full, or it would need a third row. Picture 5 is the last place where it fits; a different column count allows other choices.
Does the reading order change when the lead moves?
No. The list stays in the same order for screen readers and the Tab order; only the grid placement changes. Each square shows its number so the order is visible too.
Which keys work?
How do I use my own photographs?
The drawn pictures are one Scene component. Where the code comment says so, replace it with an <img> (object-cover in a box of the picture's own ratio) and give each entry a src. Keep each entry's ratio the photograph's own so the layout doesn't change.