shadcn.io is not affiliated with official shadcn/ui
Annotated Group Portrait Gallery Block for React
A drawn group portrait of fourteen people in three tiers beside a numbered key, where pointing at or focusing a name rings that person in the picture and the other way round.
Installation
Overview
An annotated group portrait for React with Base UI, for Thornby & Finch, a landscape-architecture co-op. A split with a framed figure at the start and, at the end, a compact header over a numbered key. The figure is a drawn picture: fourteen people, heads and shoulders in three tiers, standing in a field, each with a chip of their initials. The key is an ordered list with one row per person, their name and role. Pointing at a name or focusing it with the keyboard rings that person in the picture and fills the row; pointing at a person highlights their row. Pressing a row, or a person, pins the choice (aria-pressed), which makes it work by tap and by key too, and a polite line under the picture says who is ringed. On a phone the key goes under the picture, eight rows and a "Show all 14" button. Nobody is photographed: the heads are drawn in your theme's own greys, and the field behind them is a drawn scene. It's built from Button and Guides, with CSS transitions that stop under reduced motion. The co-op and its people are made up for the example.
FAQ
How do I use my own team?
Each entry in PEOPLE has a name, a role, initials, a tier (0 is the back row), an x position across the picture in percent and a hair style from 0 to 4. Add people to the list and give them a tier and an x; the key and the picture both read it. For a real photograph, swap the Scene and the drawn people for one <img> and place a chip button at each person's position, with the same x and top custom properties the drawn people use.
How does it work without a mouse?
The key is the keyboard route: every row is a button, so Tab reaches each one, focusing it rings the person in the picture and Enter or Space pins that choice. The people in the picture are decorative duplicates of the rows, left out of the tab order and the accessibility tree, so nothing is announced twice. Pointing at a person works as well, and a touch press on them pins them.
What does a screen reader hear?
The key is a list named by the heading: each row reads as a button with the name and the role ("Kofi Mensah, Hydrologist, toggle button, not pressed"). When a person is ringed the caption under the picture, a polite live region, says "Kofi Mensah, Hydrologist, is ringed in the picture", and goes back to a plain description when nothing is chosen.
How does it fit on a phone?
The picture goes first and the key under it. Only eight rows show, and a "Show all 14" button, with aria-expanded and aria-controls, opens the rest. The label stays the same whether the list is open or not; the button's state says which. On a desktop screen all fourteen rows are always shown beside the picture.
Related
- Pro
Hover Card Mosaic Team
Grids and wallsThe planners of an interior-planning studio as a mosaic of mixed spans that shares its hairlines: a two-by-two lead cell, two wide cells, three small ones and a +12 cell, each person a link with a hover card that opens on hover and on focus.
- Pro
Customer Creations Gallery
Masonry and mosaicEight drawn ceramic pieces on shared hairlines that re-lay between a dense mosaic and picture-and-quote cells with a toggle, holding the block's height.
- Pro
Tree View Org Chart Team
Leaders and org chartsA split org chart for a ride-share fleet: copy, an Expand all button and three figures at the start, and a working tree of twenty-two people at the end, with a band that names the picked person's manager and reports.
- Pro
Tenure Mosaic About
Team and leadersA tenure mosaic for a design-collaboration company: founders and first hires in large tiles with a fun fact on view, and newer teammates in small tiles whose fact opens in a hover card.
- Pro
Hover Card EXIF Gallery
Hairline gridsSix drawn frames in cells of their own, each a link with a hover card of camera, lens, aperture, shutter speed and ISO that opens on hover and on keyboard focus, and prints the same settings in the caption on a touch screen.
- Pro
Hexagonal Honeycomb Gallery
Masonry and mosaicNineteen hexagonal pictures in an offset honeycomb inside a framed figure, moved across with the arrow keys, the current tile enlarged and named in a live caption.