Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Since Day One Figures About Block for React

Six figures for a plant-care app that each set the Year 1 value, struck through, beside today's with an arrow, and write the change as a sign and a percent, all in foreground weights with no colour.

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 before-and-after numbers section for React with Base UI, written for Rowanly, a fictional plant-care app. Six cells each show what a number was in Year 1, struck through with a del element, an arrow, and what it is today, rolled up once on view, with the change written as a sign and a percent such as "+1,357%" or "−89%". Nothing is coloured: the sign carries the meaning, and the old figure is muted and struck through. On wide screens the cells are three by two with lines that overshoot their corners; below lg they become bands two across, ruled from rail to rail, whose rows share their heights. A quiet closing line explains the strike-through, so the block ends on content. It's built from Guides and Sliding Number, with CSS transitions for the entrance and your theme's tokens for every colour. For about pages that want to show how far a product has come without a chart. The figures are example data.

FAQ

How do I change the figures?

They are GAINS at the top of the file: a label, the Year 1 from and today's to. The change is computed from the two (rounded to a whole percent, with a true minus sign for a fall), so the text can't disagree with the figures. All the figures are example data: replace the arrays at the top of the file with your own.

Why is nothing green or red?

A falling number is good news for "seconds to identify a plant" and bad news elsewhere, so colour would have to guess. The block shows the direction as a sign and leaves the judgement to the label. The struck-through figure is muted, which also keeps the page in your theme's tokens.

How does a screen reader read a struck-through figure?

Each cell is a term (the label) with two descriptions. The first reads "Year 1: 4,200" then "Today: 61,200" through hidden text beside the del element and the arrow, and the second reads the change and "since day one".

Does today's figure count up?

Each figure is a SlidingNumber with trigger="view": it holds its final width in zeros until the block scrolls into view, then rolls up once. With reduced motion the digits still arrive at their final values, without the roll, and the screen-reader text is always the final number.

How does it fit on a phone?

Two across. The Year 1 figure takes its own line above today's so every cell has the same shape, and the rows share their heights, so a label that wraps to three lines doesn't push its neighbour out of line.

Why does the block end on a sentence?

Cells with overshooting lines and only empty space under them would read as a second rule above the next block's. The closing line sits under them, and below lg it carries the last band's rule.

  • Pro

    An asymmetric bento of company figures for an expense tool: a lead cell with the customer count over a twelve-bar trend, and five smaller cells tagged People, Customers or Product, each footnoted with how it was counted.

  • Pro

    An asymmetric bento for a subscription-analytics tool: a hero cell with the customer count over a ladder of milestones (1,000, 5,000 and 10,000 reached, with the month, and 25,000 next), and three smaller cells that say why each metric matters.

  • Pro

    Four huge figures for a beekeeping marketplace in a two by two grid with one word under each and nothing else, split by a cross of two hairlines with plus marks.

  • Pro

    A company's story told through four figures: a title stuck at the start while the reader scrolls, and rows that pair each large number with two sentences on how it happened.

  • Pro

    Five years of growth in one framed table: revenue, customers, team and NPS by year, each cell shaded by its size against its row, with a closing row of year-on-year revenue growth.

  • 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.