shadcn.io is not affiliated with official shadcn/ui
Crosshair Quad Tile Grid Stats Block for React
Four support-desk figures in the four quadrants of a crosshair, with a hairline cross at the centre where a round badge names the quarter, each with its value and its change on the quarter before.
Installation
Overview
A crosshair KPI grid for React with Base UI. A compact header states the quarter's headline ("Customers rated 94.2% of our replies satisfied in Q3") and the band below it is cut into four quadrants by one vertical and one horizontal hairline that cross at its centre, under a small round badge that names the quarter. The vertical line reaches up to the band's top rule, and the horizontal line is a rule with a + on each rail, so the cross is part of the page's drawing. Each quadrant is a label, a value that rolls up, and the change on the quarter before as an arrow and a signed number: customer satisfaction, median first reply, open backlog and reopened tickets for a support desk. Every value, change and the headline number are computed from one typed pair of quarters. On a phone the four quadrants become four rows, each under its own rule, and the centre badge is hidden. It's built from Guides, Badge and SlidingNumber.
FAQ
How do I change the figures and the quarters?
Edit QUARTER, BEFORE and KPIS at the top of the file. A figure has a label, this quarter's value, the previous one, a suffix, its decimals and a change kind: points for a rate (+1.4 pts) or unit for a count in the figure's own unit (−5 min). The values, the signs, the arrows and the headline are read from them. The quarter names are plain text, so the copy never goes stale.
How is the cross drawn?
It is made of the page's own lines, not a picture. The band's top rule comes from Guides, the second row of cells has a Guides rule on top (with a + at each rail and one at the centre), and the second column has a start border that runs from the top rule to the foot. The round badge is absolutely positioned with inset-0 and m-auto, which centres it on the crossing with no offsets, so it stays centred in right-to-left pages and at any height.
What happens on a phone?
The grid becomes one column of four rows. The vertical line and the centre badge go away, and each row after the first gets its own rule with + marks on the rails, so the horizontal lines survive. The DOM order never changes: satisfaction, first reply, backlog, reopens.
Is it accessible?
Yes. The four quadrants are list items, each with a heading for its label. The badge is decorative and hidden from assistive technology, because the quarter is also written in the header and in each change ("vs Q2"). The arrows are hidden too, since the sign says the same; the minus is a true minus sign, read as "minus". Numbers sit in bdi elements, and signed changes are kept left to right.
Related
- Pro
Icon KPI Tile Grid Stats
KPI bands and tilesFour linked KPI tiles for a home-services marketplace, each an icon plate, a value, a label and an Open report line, in a hairline frame beside a split divider.
- Pro
Dual Gauge Comparison Stats
ComparisonsTwo open 270-degree dials side by side for a sprint-tracking tool, each with its percent done, with a round chip on the divider that gives the gap between the two teams in points.
- Pro
Vertical KPI Rail Stats
KPI bands and tilesA split for a shipment tracker: the headline and the week at the start, and past a hairline divider four figures stacked in a narrow rail, each with its change on the week before.
- Pro
Delta Pill KPI Tiles Stats
KPI bands and tilesFour raised KPI tiles for a checkout analytics tool, each with its change as a pill: filled for a rise, outlined for a fall and muted for none, with an arrow or a dash and a sign.
- Pro
Period Comparison Table Stats
ComparisonsA five-row month-on-month report with this period, the period before, and a bar for the size of each change.
- Pro
Connected KPI Bar Stats
KPI bands and tilesFour 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.