shadcn.io is not affiliated with official shadcn/ui
Categorized Tabs Gallery Block for React
A vertical list of five collections, each with its count, beside a grid of that collection's pictures on shared hairlines, with the list carrying the divider.
Installation
Overview
A categorised gallery for React with Base UI, for Stockroom, a library of vector illustrations. A split puts a vertical list of five collections at the start, each with the number of pictures in it, and beside it a panel with the collection's name, "6 pictures" and a grid of its pictures on shared hairlines. The list is the catalog Tabs and carries the divider, with a + mark where it meets the top rule. The collections differ in size, so an unseen copy of every panel holds the block's height. On a phone the list becomes a row of chips above the grid. A polite line says "Showing 6 of 24 pictures in Botanicals". The pictures are drawn, not photographed, in your theme's own greys. It's built from Tabs and Guides. The library and its pictures are made up for the example.
FAQ
How do the collections work?
The list is a vertical Tabs: the arrow keys move between collections (Up and Down), Home and End jump to the first and last, and each tab owns one panel. The counts on the tabs and in the panel caption are derived from each collection's pictures. When a collection has fewer pictures, the last row is finished with blank cells so the hairlines stay in whole rows.
Why doesn't the page jump when the pictures change?
An unseen copy of all 24 pictures (hidden from assistive technology and from the keyboard) sits in the same grid cell as the live set, so the block is always as tall as the full gallery and the shown pictures stay at the top. Nothing below the block moves.
How does it fit on a phone?
Below the large breakpoint the list lies down as a row of chips that scrolls sideways, with the chosen one filled in the text colour, and the grid is two across. The list is still a vertical Tabs, so on a phone with a keyboard attached Up and Down move between chips, as on a wide screen.
How do I use my own photographs?
Each picture is typed data with a description (its alt text), a scene and a ratio. Add your image's address to it, then replace the Scene in its tile with <img alt="" className="size-full object-cover" src={…} />: the caption already names the picture, and the role="img" wrapper's label can move to the alt. The comment above Scene says where. Tiles crop to a fixed shape, so keep object-cover.
How are the pictures drawn?
Each one is a scene: a kind (a room, a lamp, a bridge, a pattern…) and three numbers, light, horizon and a seed that moves ridgelines, lights windows and turns tiles. Each kind is a function that returns the picture as SVG paths painted with a few inks mixed from your theme's colours, so two pictures of one kind with different numbers differ. Nothing is random at render time: the server and the browser draw the same picture.
Does it follow my theme?
Yes. Every colour is mixed from your foreground, background and muted tokens, so the pictures print dark on pale grey in a light theme and turn low-key in a dark one. The chosen state of every control is the text colour on the page colour; the primary colour stays on the page's one action. The block ends on its last row with no closing line, so the next section's top rule closes it.
Related
- Pro
Filterable Gallery
Filter, sort and tabsTwelve drawn pictures on shared hairlines with a band of chips, each with a count, that keeps only one kind of work and says how many are showing.
- Pro
Tab Categories Gallery
Filter, sort and tabsA band of four tabs where each panel is a collection's own page: a large cover, its name, two lines about it, its picture count and four more pictures.
- Pro
Tagged Gallery
Filter, sort and tabsTwenty-four drawn pictures filtered by a cloud of ten tags with live counts that combine with AND, removable chips, a Clear button and an empty state.
- Pro
Category Grid Tab-Filtered Logos
Tabs and filtersFour pill tabs (All, Growers, Co-ops, Advisers) over a wall of eight customer wordmarks in shared hairline cells, for a farm planning tool.
- Pro
Categorized FAQ
Topics and filtersA topic-tabbed FAQ for a bookkeeping app: a compact header, a band of line tabs with a count on each, and one accordion per topic.
- Pro
Vertical Tabs Lessons Learned
TimelinesA lessons-learned section for a retrospectives tool: a vertical tab list of six post-mortems with the year each happened, and the open one as what happened, what we learned and what changed.