shadcn.io is not affiliated with official shadcn/ui
Highlight Filter Team Block for React
Eighteen people of an event-ticketing company on a dense wall of hairline cells, with department chips that dim everyone outside the selection in place, so nobody moves and the wall keeps its height.
Installation
Overview
A department filter for React with Base UI, for Pennard, an event-ticketing company. A compact header sits over a band of five department chips (Engineering, Design, Product, Support and Partnerships), each with its headcount, and a wall of eighteen people in cells that share their hairlines, six across from lg. Each cell is an initials avatar, a name and a role. Pick one or several chips and everyone outside the selection dims where they stand while the picked people's avatars turn solid: nobody is removed or moved, so the wall keeps its shape and its height, and the departments are interleaved so a pick lights up the whole wall. A polite line counts the people highlighted, and a Clear button resets the chips. On a phone the wall is three across with the roles read but not shown, and the chips scroll sideways. It's built from Toggle Group, Avatar, Button and Guides, with CSS transitions and your theme's tokens for every colour. For about pages and team pages where the point is to see how a company is spread across departments.
FAQ
How do I change the people and the departments?
Edit PEOPLE and DEPARTMENTS at the top of the file. A person is a name, a role and a department; the chips' headcounts and the live line are counted from the same data. Keep the people in the order you want them on the wall: the file doesn't re-sort them. Eighteen fills the rows at three and six columns; another count leaves a short last row, which still has its lines because each cell draws its own.
Why dim people instead of hiding them?
Hiding leaves holes and makes the block shrink, which moves everything below it. Dimming keeps every cell where it was: the cell takes a light tint, the avatar turns to an outline and the name to the muted colour, all at AA contrast in light and dark themes, while the picked people's avatars fill solid. Nothing is removed from the list, so a screen reader still meets all eighteen, and it also reads the department after each role.
How do the chips work with a keyboard and a screen reader?
They are a toggle group named Departments: Tab moves into it, the arrow keys move between chips, and Space or Enter presses one. Several can be pressed at once, and with none pressed everyone is shown normally. Each chip is read with its headcount ("Engineering, 5 people"), and a polite line says how many people are highlighted ("7 of 18 people highlighted").
How does it fit on a phone?
The chips scroll sideways from rail to rail, with the next chip peeking in. The wall is three columns and shows all eighteen people, six short rows, so a picked department is never hidden behind a button; the roles are read by screen readers but not shown, to keep the cells small. Picking a chip changes colours only, so the page does not move.
How are the lines drawn?
Each cell draws only its end and bottom borders, and a wrapper clips the last column's and the last row's, so the page's rails and the next block's top rule close the wall without doubling. The band's rule and the wall's top rule, with + marks where they meet the rails, come from Guides.
Related
- Pro
Grid Cards Team
Grids and wallsTwelve people of a restaurant-software company in a hairline grid that runs from rail to rail, each an initials avatar with a name, a role, a department badge and a city, under a department picker that brings the picked team to the front and dims everyone else.
- Pro
Department Tabs Team
Tabs and accordionsThirty people of a grocery-delivery company by department: underline tabs with headcounts, then each panel opens with its lead on a tinted band and the team as two columns of hairline rows.
- Pro
Searchable Directory Team
Lists and directoriesA field-service company's eighteen people in one table, under a ruled band with a search field, department and city selects, a live count and a clear button, with an empty state when nobody matches.
- Pro
Vertical Tabs Team
Tabs and accordionsThe people of a help desk in a split: a vertical tab rail of five departments, each with its headcount and three avatars, beside a page that says what the team owns, shows its lead and lists the team.
- Pro
Filterable Testimonials
Filter and searchRole chips with live counts filter a wall of eight customer quotes, with a status line, a clear button and an empty state. A hairline band holds the controls and the cells' lines overshoot their corners.
- Pro
Badge Counter Wall Features
Metrics and chartsA wall of eight channel counters for a unified inbox, with a two-button toggle that switches between every channel and only those with unread messages.