Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Grid Reveal Team Block for React

Eight people of a vet-booking tool in a hairline grid where picking a cell opens a full-width band right under its row: a quote, two skills and what to ask the person about, with the picked cell marked by a bar.

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 Stockleigh, a booking tool for veterinary clinics. A start-aligned header sits over a grid of eight people that shares its hairlines and runs from rail to rail. Each cell is a button with an initials avatar, a name and a role. Picking a person marks their cell with a bar and opens a band across the full width under their row: their tenure, a quote, two skills and what to ask them about. One person is always open, so the block keeps its height; the first is open when the page loads. Arrow keys move between cells. Four columns from lg, two below, and on a phone the band opens under the tapped row. It's built from Avatar, Badge and Guides, with a CSS fade and your theme's tokens for every colour. For team pages that want every person's story without eight accordions.

FAQ

How do I change the people?

Edit PEOPLE at the top of the file. A person is a name, a role, a tenure ("Year 4": never a calendar year), a quote, two skills and an ask phrase. Eight fills two rows at four columns and four rows at two. If you change the count, keep the last row in mind: LAST_ROW_START works out where it starts so that the rule under the last row only shows when the open band sits there.

How does it work with a keyboard and a screen reader?

Tab moves to a cell, the arrow keys move focus between cells (they follow the page's direction, so they flip in a right-to-left layout), and Enter or Space opens that person. Each cell says whether it is open (aria-expanded) and which band it controls (aria-controls), and a polite line says whose bio is open. In reading order the band comes after the eight cells; aria-controls ties it to the cell that opens it.

How does the band open under the right row?

The grid has no gaps, and each cell and the band sit in a grid row of their own: people in the odd rows, the band in the even row under the picked person's. Each element carries its rows for both column counts as CSS variables, so the browser places it with no measuring and no script, and an empty row collapses to nothing. COLUMNS holds the two column counts and must match the grid's classes.

Why is one person always open?

Closing the band would move everything below the block, and a block that changes height on every click is hard to read. Picking another person moves the band and keeps its height about the same; keep quotes to about the same length so it does.

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

Each cell draws its end and bottom borders, except the last column's end (the page's rail draws that) and the last row's foot, which the next block's top rule closes. The band draws its foot too unless it is under the last row, and its top corners carry the + marks where it meets the rails.

What moves, and what happens with reduced motion?

The band fades in when it opens, a cell's tint and its bar change on hover, focus and pick, and the block fades up when the page loads. All of these are CSS and are off with reduced motion; the band still opens.

  • Pro

    Accordion Profiles Team

    Tabs and accordions

    Ten people of a recruiting-tool company as hairline accordion rows that run from rail to rail; opening a row shows the department, a two-line bio, a personal quote and two text links, one row at a time.

  • Pro

    Profile Drawer Team

    Lists and directories

    Eight people of a design agency as rows that each open one side drawer with a quote, a bio and three career figures, with Previous and Next buttons that step through the team without closing the drawer.

  • Pro

    Hover Reveal Team

    Lists and directories

    Six people of an architecture practice as a bare list of names and roles; hovering or focusing a row opens a hover card with the bio, base city and previous studios, and every row is also a link to the profile.

  • Pro

    Grid Cards Team

    Grids and walls

    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.

  • Pro

    Hover Card Mosaic Team

    Grids and walls

    The 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

    Flip Cards Team

    Grids and walls

    Four people of a florist network as cards that turn over in 3D on a button press: the front is initials, a name and a role, the back a quote and two things to ask them about; reduced motion cross-fades.