Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Stats Overview Team Block for React

Four people figures with their change on a year ago, over seven department rows whose bars draw what each department was a year ago and what it has added since.

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-in-numbers section for React with Base UI, written for Almondbury, fictional restaurant till software. A centred header states the headline, computed from the data ("142 people, 30 more than a year ago"). Under it two bands run from rail to rail and end the block. The first is four people figures (headcount, countries, average tenure, open roles) in cells that share their hairlines, each with its change on a year ago as an arrow and a sign. The second is a list of seven departments: a name, a bar and the department's headcount with its change. The bar is drawn in two weights of the foreground colour, what the department was a year ago at full weight and what it has added since in a lighter one, so the growth reads without a legend you have to decode (the legend is there anyway). The headcount, the title and every bar come from one typed list. Four figures across from lg, two by two below it; on a phone each bar drops under its department's name. It's built from Guides and your theme's tokens, with CSS transitions for the bars and the entrance. Every figure is about the team: business numbers belong to the stats blocks. The figures are example data.

FAQ

How do I change the departments and the figures?

Edit DEPARTMENTS and FIGURES at the top of the file. A department is a name, its people a year ago (before) and its people now (now). The headcount figure, the title ("142 people, 30 more than a year ago"), the change beside every department and the length of every bar are computed from that list, so adding a department needs no other change. Countries, tenure and open roles are typed figures with a reading from a year ago, from which their change is computed.

How should I read the bars?

Every bar is drawn against the largest department, so lengths compare across rows. The full-weight part is the people the department had a year ago, the lighter part is what it added since, and the number and arrow at the end of the row say the same in text. If a department shrinks, its bar shows only what is left, at full weight, and its change takes a minus sign and a downward arrow.

Why are there no green and red arrows?

A rise in headcount is not always good news, and a fall in open roles is not always bad news, so the block doesn't judge. A change is an arrow and a sign in the foreground colour, with a true minus sign so screen readers say "minus". The bars use two weights of the foreground colour, so the block follows any theme.

How is it read by a screen reader?

The four figures are a list, and each is a description list of its own: the label, the value and the change come in that order, with the value drawn above the label. The departments are a list, each with an h3 for its name and its numbers as text. The bars are drawn parts, hidden from assistive technology.

How does it fit on a phone?

The figures go two by two, and each department row puts its bar under the name and the number instead of between them, so nothing needs to scroll sideways at 320 pixels. The change labels keep the same width, so the numbers line up from row to row.

Does it work right to left?

Yes. The values are wrapped in bdi and the signed changes keep their order, trend arrows do not mirror, and the bars fill from the start of the track, which is the right edge in a right-to-left page.

  • Pro

    Animated Counter Team

    Numbers and history

    A short strip of four centred people figures that roll up once as they scroll into view, over a closing row with the newest eight people as initials.

  • Pro

    Growth Timeline Team

    Numbers and history

    A headcount step chart over six years with a dot and a count at every jump and the biggest rise drawn heavier, over six cells naming the first hire of each kind.

  • Pro

    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.

  • 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

    Connected KPI Bar Stats

    KPI bands and tiles

    Four headline figures for a subscription analytics tool in cells that share their hairlines from rail to rail, each with its change on the month before and a tiny sparkline of the last twelve months.

  • Pro

    Four counters for an uptime monitor in one hairline band, each rolling up once on view with an arrow and a sign for how it moved on last month, under a header that says when the figures were last updated.