Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Team Breakdown Bars About Block for React

A team counted three ways in 100% bars (by function, location and tenure), where choosing a segment in the legend names its share and count under the 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 breakdown for React with Base UI, written for Rosterwell, fictional shift-scheduling software. The title says how many people there are, and three bands show the same team cut three ways: by function, by location and by tenure, side by side between solid dividers on wide screens and stacked on a phone. Each band is a 100% bar of segments in foreground weights. Under it a line names the chosen segment's share and count, and the legend below is the control: a toggle group in which choosing a segment makes it stand taller in its bar and rewrites the line. Shares are rounded by the largest remainder so each bar adds up to 100, and the block checks that every bar counts the same headcount. For about pages, careers pages and investor updates. The figures are example data.

FAQ

How do I change the groups and the segments?

GROUPS holds the three bars: a title, the segment that starts chosen and the segments, each with a name and a count. Keep the same total in every group (the title uses the first group's). Up to five segments have a fill in TONES; add a tone to use more.

How does choosing a segment work?

Each band has its own single-choice toggle group, so each bar has one chosen segment at a time and you cannot switch them all off. The chosen item is outlined in the foreground, its segment grows taller in the bar, and a polite line under the bar says the share and the count. The toggle group's API differs between libraries, so the block is written for each target.

How is a bar read by a screen reader?

Each bar is one image whose name lists every segment with its share ("By function: Engineering 40%, Product and design 14%, ..."). The legend items are toggle buttons with their count in text, and the line under the bar is announced politely when the choice changes.

Why do the shares always add up to 100?

Each share is rounded down, and the spare points go to the segments with the largest remainders. A bar with three segments of 40.5% rounded naively could show 101%; this never does.

How does it fit on a phone?

The bands stack, each under its own rule with corner marks, and the legend wraps onto more lines. Nothing scrolls sideways.

  • Pro

    Headcount over six years as stacked columns by department, where choosing a year (focus, hover or tap) lists its departments with counts and shares.

  • Pro

    A representation section for a hiring company, with paired bars for the company and its leadership, the gap written out, and the hiring changes still in force.

  • Pro

    Office rows for a global payroll company, each with a country code, a time-zone offset and a headcount bar drawn to the scale of the largest office.

  • Pro

    Team Avatar Strip About

    Team and leaders

    A compact about strip for an HR tool: overlapping initials, the headcount, a department bar that names a segment on hover, focus and tap, and a hiring line.

  • Pro

    Overlap Hours About

    Team and offices

    An about section for a time-zone scheduler: three offices on a 24-hour axis, with the hours they all share labelled and counted.

  • Pro

    Copyable Fact Sheet About

    Press and recognition

    A company fact sheet for a patient-records tool: six facts as a two-column description list in ruled rows, beside a boilerplate paragraph written from the same facts and a Copy button that puts it on the clipboard.