Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Grid Cards Team Block for React

Twelve 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.

Framework
UI library

Preview

Preview width

Installation

Part of Pro
Pro unlocks the code and one-line install of every Pro button and text effect, plus the MCP for your AI editor.
Have Pro already? Sign in to open it.Opens here as soon as you're Pro.

Overview

A team section for React with Base UI, for Tabletide, a rota and payroll app for restaurants. A compact header says how many people work there and in how many cities, and holds a department picker: All, Engineering, Design, Product and Support, each with its headcount. Under it the twelve people sit in cells that share their hairlines and run from rail to rail, so the grid ends the block and the next block's top rule closes it. Each person is an initials avatar in one of three greyscale tones, a name, a specific role ("Staff engineer, payroll"), a department badge and a city. Pick a department and its people move to the front of the grid while everyone else stays in place behind them, dimmed: the grid stays whole and the block keeps its height. Four columns from lg and three from sm; a phone has two, and shows six people and a Show all button. It's built from Segment Group, Avatar, Badge, Button and Guides, with CSS transitions and your theme's tokens for every colour. For about pages, careers pages and any team small enough to show everyone.

FAQ

How do I change the people and the departments?

Edit PEOPLE and TEAMS at the top of the file. A person is a name, a role, a team and a city; the initials come from the name, and the avatar's tone from the person's place in the list. The picker's headcounts and the header's "12 people in 11 cities" are counted from the same data, so adding someone needs no other change. Twelve fills every row at two, three and four columns; another count leaves a shorter last row, which still has its lines, because each cell draws its own.

How does the department picker work with a keyboard and a screen reader?

It's a radio group named Department. Tab moves into it and the arrow keys move between the options, selecting as they go; each one is read with its headcount ("Engineering, 4 people"). A polite status line reads the result ("Engineering first: 4 of 12 people") without moving focus. The picked team also comes first in the list itself, so a screen reader meets those people first, and the others follow, still in the list.

Why are the other people dimmed rather than hidden?

Hiding them would leave a grid with a hole and a block that shrinks, which moves everything below it. Instead the picked team moves to the front, in its usual order, and everyone else stays behind it: their avatars turn to outlines, their names to the muted colour and their cells take a light tint. Every word still meets AA contrast, in light and dark themes. Every row has the same height, so the block never changes size when you pick.

How does it fit on a phone?

Below sm the grid is two columns and shows the first six people, then a Show all 12 button in a band under it. The button is a disclosure: it says whether the list is expanded and which list it controls, and its label stays the same. The picker scrolls sideways from rail to rail when its options don't fit. In a half-width cell the department badge would crowd the avatar, so it's read to screen readers but not shown; each role keeps room for two lines, so a re-sorted grid keeps its height.

How are the lines drawn, and how does the block end?

Each cell draws only its end and bottom borders. A wrapper clips the last column's and the last row's, so the page's rails close the sides and the next block's top rule closes the foot: no line is ever doubled. The grid's top rule, with + marks where it meets the rails, comes from Guides. On a phone the Show all band draws the rule under the six people instead.

Can I use photos instead of initials?

Yes: add a picture to each person and put an AvatarImage in the Avatar, before the fallback; the initials show until the picture loads, and whenever it fails. Keep the pictures square and greyscale if you want the grid to stay as calm as the initials. The avatar is decorative (the name is in the heading next to it), so the picture needs no alternative text.

  • Pro

    Department Tabs Team

    Tabs and accordions

    Thirty 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

    Highlight Filter Team

    Grids and walls

    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.

  • Pro

    Split Avatar Grid Hero

    Logos and social proof

    A compact split team hero: a headline, a Shine Button, a second action and a line of team facts beside a two-by-two grid of large avatars with names and roles in cells that share hairlines.

  • Pro

    Filterable Testimonials

    Filter and search

    Role 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

    A presence callout for a team workspace: a live "4 of 5 teammates active" count over a band of five cells, each an initials avatar with an active or idle dot, a name and the document they are in.

  • Pro

    Department Bento Team

    Grids and walls

    The six teams of a school-transport operator as a bento of cells that stand apart: the drivers fill a two-by-two cell with a large headcount and a group of avatars, and every other team has a headcount, a lead and a line on what it owns.