StatsRow block renders a compact, high-contrast row of statistics — typically program metrics like student count, sponsor count, or placement rate. Stats are displayed in a 2×4 responsive grid (two columns on mobile, four on md+) with oversized numerals and small-caps labels.
Props
Optional centred section heading above the stats grid, rendered at
2xl–3xl.Array of stat objects. At least one stat is required. Rendered as four evenly-spaced columns.
Only
dark is treated specially: the section uses bg-foreground text-background with a matching border. All other values use bg-muted with a border-border rule. Defaults to white (renders as the muted/light style).Vertical padding override. Defaults to
default. The section uses size="sm" internally, so padding is already compact.Content container max-width. Defaults to
default.Additional CSS classes.
HTML
id for anchor targeting.StatItem fields
Each entry instats is a statItem object:
Usage in Sanity Studio
- Add a Stats Row block to a page.
- Add an optional Heading.
- In Stats, click Add item for each metric:
- Value: the large display number or string (e.g.
"200+"). - Label: the short descriptor (e.g.
"Students Placed").
- Value: the large display number or string (e.g.
- Expand Layout Options and set Background Variant to
darkfor a reversed colour scheme.
Variants / Options
Novariant field. The only visual toggle is backgroundVariant:
backgroundVariant | Background | Text | Border |
|---|---|---|---|
white / light / primary | bg-muted | foreground | border-border |
dark | bg-foreground | text-background | border-foreground |