Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Layout Toggle Team Block for React

Ten engineers of a log-analytics tool in a tinted Frame around a raised panel, with a List and Grid toggle that re-lays the same people between hairlines and an outline Lead badge on the team leads.

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 roster section for React with Base UI, for Greymarsh, a log-analytics tool. At the start, a header with three figures (engineers, team leads, cities); beside it, an inset: a tinted Frame shell around one raised Frame Panel, wrapped in + corner marks. The panel's toolbar holds a Layout toggle, List or Grid, that re-lays the same ten engineers between hairlines, and team leads carry an outline Lead badge. The slug says dark, but the block follows your theme: the tinted shell and the raised panel do the work a dark background did in the source. A phone shows the list only: no toggle, no figures and no cities. It's built from Frame, Toggle Group, Avatar, Badge and Guides, with CSS transitions and your theme's tokens for every colour. For engineering pages, "meet the team" sections and any roster that readers may want to scan or browse.

FAQ

How do I change the engineers and mark a lead?

Edit ENGINEERS at the top of the file. An engineer is a name, a role, a city and a lead flag: set it to true to give them the outline Lead badge. The figures in the header and the toolbar's count are counted from the same list, so adding someone needs no other change.

How does the List and Grid toggle work?

It is a group of two toggle buttons named Layout. One is always pressed: pressing the pressed one keeps it, and pressing the other moves the choice. The same ten rows re-lay between one-pixel hairlines, one per row in the list and two across in the grid, and a polite status line says what changed ("10 engineers, shown as a grid"). The state is a single value, so the list's markup never changes.

Why is it called dark if it follows my theme?

The source was a flat list on a dark background. This version keeps the URL and replaces the darkness with structure: a tinted Frame shell around a raised panel with a ring and a soft shadow, which reads as lifted on a light page and on a dark one alike. Nothing is a fixed colour.

How does it fit on a phone?

Below sm the toggle is hidden and the roster is always the list: names and roles in rows, without the cities, and the header's figures are left out so the first row starts within the first screen. From sm the toggle appears and the grid is two columns. Nothing scrolls sideways at 320 pixels.

How are the lines drawn?

The spine's rails and top rule come from Guides. The framed panel is wrapped in its own Guides, with sides, overshoot past the corners and a + on each corner, set 8 pixels away from the frame. Inside the panel, the roster is a one-pixel gap on a border-coloured background with background-coloured cells, so the hairlines are the same in both layouts.

What moves, and what happens with reduced motion?

The header and the frame fade up once when the page loads, off with reduced motion. Switching layouts changes the arrangement at once, with no animation.

  • 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

    Searchable Directory Team

    Lists and directories

    A 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

    Sortable Directory Team

    Lists and directories

    A document-signing company's ten people in a table whose cells share their hairlines, sorted by name, department or tenure from the header, with a tenure bar and a live sort announcement.

  • Pro

    Compact List Team

    Lists and directories

    The quiet roster of a fleet-telematics company: one dense line per person at forty pixels, rail to rail, twelve shown and the other twelve opened in place from a Show all button.

  • 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

    Card Inset Metric Row CTA

    Figures and stats

    A start-aligned card-in-card CTA for an API platform: a headline, one sentence and two calls to action, with three platform figures in a closing band across the foot of the panel.