Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Metric Tile Row Stats Block for React

An asymmetric band of four figures for a property-management tool: one double-width hero cell for rent collected and three small cells for occupancy, arrears and renewals, each with its change on the month before.

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

An asymmetric metric band for React with Base UI. A start-aligned header states the headline, "96.9% of March rent is in", with the period and its comparison at the end of the row. Under it, one band runs from rail to rail and ends the block: the hero cell spans two of five columns on a quiet tint and shows rent collected as a big number that rolls up once, its change on February as an arrow and a signed percent, and what was due; the three small cells beside it (occupancy, arrears and lease renewals) share the other three columns, divided by hairlines. On a phone the hero takes the full width and the three small cells sit under it as a row of three. The headline, the changes and the collection rate are all computed from two typed months of readings, so the text can't disagree with itself. It is built from Guides, the Sliding Number, Lucide arrows and CSS transitions, and it follows your theme: no colour for good or bad. For property, finance and operations pages where one figure leads and three support it.

FAQ

How do I change the figures?

Edit MARCH and FEBRUARY at the top of the file. Rent collected, rent due, occupancy and renewals come from MARCH; FEBRUARY holds the month before. Arrears is worked out as rent due less rent collected, the collection rate in the headline is collected over due, and every change is computed from the two months, so nothing is typed twice. Month names are plain text with no year, so the copy never goes stale.

Why does one cell span two columns?

The block is about one figure that leads and three that support it, so the hero cell is lg:col-span-2 of a five-column grid, on a solid tint, and its number is far larger than the others. If you want a different split, change the grid's column count and the hero's span together; the three small cells always take whatever is left.

Why aren't the changes green or red?

Whether a change is good depends on the figure: arrears going down is good news, occupancy going down isn't. Each change is an arrow and a sign in the text colour, and the reader judges it. That also keeps the block correct in every theme and readable without colour.

Is it accessible?

Yes. The figures are one description list: each label is a term, and its value, change and comparison are its descriptions, so a screen reader hears the label before the value. The arrows are hidden from assistive technology because the sign says the same, and the minus is a true minus sign. Values sit in bdi elements and signed changes stay left to right, so a right-to-left page keeps them in order.

What moves, and how does it fit on a phone?

The header and the band fade up once on load and the numbers roll up when they scroll into view; with reduced motion everything simply appears with its final value. On a phone the small cells drop the repeated "vs February" (the header says it once, and screen readers still hear it), so three figures fit side by side at 320 pixels without scrolling sideways.

Why is there no line under the band?

The band ends the block, so the next section's top rule is its foot. A bottom border here would double that rule, and the column has no bottom padding for the same reason.

  • Pro

    One headline figure for a treasury tool, cash on hand in a big number inside a card in a card, with a change pill, a comparison and a two-line footnote that says when it was read and from where.

  • 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

    A parcel carrier's weekly total in display type at the start of a split, with its three service levels as rows at the end, each with its count and a share bar, so the shares add up to exactly 100%.

  • Pro

    One number and nothing else for a food-bank tool: the week's meals served in display type under the page's top rule, one hairline and one sentence that compares it with last week and last year.

  • Pro

    Metric Hero Strip Features

    Metrics and charts

    Four metric-over-feature columns for a data-pipeline tool: a giant tabular figure and label, then the feature that makes it true, in one divided band under a centred header.

  • Pro

    A giant static member count for a loyalty platform under a centred header with two buttons, then a band of three secondary figures and a closing strip of eight customer wordmarks.