Stats Horizon
Four figures below a bright cyan seam on a dark ground, under a serif headline and a small report label.
import { Eyebrow } from "@/components/eyebrow/eyebrow"
import { GlowSeam } from "@/components/glow/glow-seam"
import {
Stat,
StatGroup,
StatLabel,
StatValue,
} from "@/components/stats/stats"
import { Subheading } from "@/components/subheading/subheading"
import { Text } from "@/components/text/text"
// The copy: change text here, not in the markup.
const COPY = {
eyebrow: "Studio figures",
title: "A snapshot of the work.",
description:
"A year at the studio in four numbers. A single horizon separates the story from the measures.",
report: "FIELD REPORT",
reportAside: "003 / 2026",
} as const
const STATS = [
{ value: "24", label: "Studies completed" },
{ value: "7", label: "Active experiments" },
{ value: "96%", label: "Review rate" },
{ value: "2.1h", label: "Average study time" },
] as const
/** Four figures sit below a bright cyan Glow Seam on a dark ground, under an introduction and a small report label. */
export default function StatsHorizon01() {
return (
<div className="dark relative isolate flex min-h-[440px] w-full max-w-[1240px] min-w-0 flex-col justify-center gap-12 overflow-hidden rounded-[16px] bg-background p-10 text-foreground [--font-display:var(--font-serif)] max-[600px]:min-h-[400px] max-[600px]:rounded-[12px] max-[600px]:p-[28px_24px]">
<div className="grid grid-cols-[minmax(0,1fr)_auto] items-end gap-10 max-[600px]:grid-cols-1 max-[600px]:gap-7">
<header className="relative z-2 grid max-w-[650px] min-w-0 gap-6">
<Eyebrow variant="mono">{COPY.eyebrow}</Eyebrow>
<Subheading>{COPY.title}</Subheading>
<Text variant="muted" className="max-w-[500px]">
{COPY.description}
</Text>
</header>
<Eyebrow variant="mono" className="text-right max-[600px]:text-left">
{COPY.report}
<br />
{COPY.reportAside}
</Eyebrow>
</div>
<GlowSeam
color="cyan"
tone="glow"
className="my-1 h-[2px] [&>div:first-of-type]:h-[2px]"
/>
<StatGroup
cols={1}
gap="none"
className="min-w-0 grid-cols-4 gap-7 max-[600px]:grid-cols-2 max-[600px]:gap-x-5"
>
{STATS.map((metric) => (
<Stat key={metric.label} className="min-w-0">
<StatValue className="text-[clamp(28px,5cqw,52px)]/[1.15] tracking-[-0.055em] [overflow-wrap:anywhere] tabular-nums">
{metric.value}
</StatValue>
<StatLabel className="text-xs/[1.8] text-muted-foreground">
{metric.label}
</StatLabel>
</Stat>
))}
</StatGroup>
</div>
)
}
import { mergeProps } from "@base-ui/react/merge-props"
import { useRender } from "@base-ui/react/use-render"
import { cva, type VariantProps } from "class-variance-authority"
import { cn } from "cn"
const eyebrowVariants = cva("text-eyebrow", {
variants: {
/**
* `default` is a 14px/20px label. `icon` adds a row with a 16px icon
* and a 12px gap; put the icon first and give it `aria-hidden`.
* `mono` and `caps` are 12px/20px uppercase labels with 0.12em
* tracking, in the mono and inherited faces respectively.
*/
variant: {
default: "text-sm/5 font-medium text-eyebrow",
icon: "flex items-center gap-3 text-sm/5 font-medium [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
mono: "font-mono text-xs/5 font-medium tracking-[0.12em] uppercase",
caps: "text-xs/5 font-medium tracking-[0.12em] uppercase",
},
},
defaultVariants: { variant: "default" },
})
/**
* A short label above a heading, rendered as a `<p>` at weight 500.
* The default is 14px/20px in the kit's eyebrow color. The surrounding
* layout controls the space to the heading. Use `className` to customize
* the typography or color, and `render` to change the element.
*/
function Eyebrow({
className,
variant = "default",
render,
...props
}: useRender.ComponentProps<"p"> & VariantProps<typeof eyebrowVariants>) {
return useRender({
defaultTagName: "p",
render,
state: { slot: "eyebrow", variant },
props: mergeProps<"p">(
{ className: cn(eyebrowVariants({ variant }), className) },
props
),
})
}
export { Eyebrow, eyebrowVariants }
import type * as React from "react"
import { cn } from "cn"
// Diegetic seams, two marks. GlowSeam is the horizontal section divider
// (rose); StandingSeam is the vertical line marking the active item (cool).
// Each follows its ground: a lit seam on dark, the same hue as ink on light.
/** One face of a seam: the bright line, its edges and the bloom around it. */
type SeamFace = { core: string; edge: string; bloom: string }
/**
* The named seam colors. Each has a `glow` face for dark grounds, a lit line
* at high lightness, and an `ink` face for light grounds, the same hue as a
* deeper ink. Rose is the Glow Seam's default and cyan the Standing Seam's.
*/
const SEAM_COLORS = {
rose: {
glow: {
core: "oklch(0.88 0.08 25)",
edge: "oklch(0.72 0.13 15 / 0.9)",
bloom: "oklch(0.68 0.14 20 / 0.55)",
},
ink: {
core: "oklch(0.3 0.1 20)",
edge: "oklch(0.45 0.13 15 / 0.9)",
bloom: "oklch(0.45 0.14 20 / 0.28)",
},
},
cyan: {
glow: {
core: "oklch(0.92 0.05 235)",
edge: "oklch(0.8 0.09 230)",
bloom: "oklch(0.7 0.1 232 / 0.55)",
},
ink: {
core: "oklch(0.32 0.07 235)",
edge: "oklch(0.45 0.09 230)",
bloom: "oklch(0.45 0.1 232 / 0.3)",
},
},
amber: {
glow: {
core: "oklch(0.91 0.063 78)",
edge: "oklch(0.77 0.14 78 / 0.9)",
bloom: "oklch(0.7 0.14 78 / 0.55)",
},
ink: {
core: "oklch(0.32 0.098 78)",
edge: "oklch(0.45 0.126 78 / 0.9)",
bloom: "oklch(0.45 0.14 78 / 0.28)",
},
},
coral: {
glow: {
core: "oklch(0.91 0.0675 36)",
edge: "oklch(0.77 0.15 36 / 0.9)",
bloom: "oklch(0.7 0.15 36 / 0.55)",
},
ink: {
core: "oklch(0.32 0.105 36)",
edge: "oklch(0.45 0.135 36 / 0.9)",
bloom: "oklch(0.45 0.15 36 / 0.28)",
},
},
ice: {
glow: {
core: "oklch(0.91 0.0405 255)",
edge: "oklch(0.77 0.09 255 / 0.9)",
bloom: "oklch(0.7 0.09 255 / 0.55)",
},
ink: {
core: "oklch(0.32 0.063 255)",
edge: "oklch(0.45 0.081 255 / 0.9)",
bloom: "oklch(0.45 0.09 255 / 0.28)",
},
},
violet: {
glow: {
core: "oklch(0.91 0.063 295)",
edge: "oklch(0.77 0.14 295 / 0.9)",
bloom: "oklch(0.7 0.14 295 / 0.55)",
},
ink: {
core: "oklch(0.32 0.098 295)",
edge: "oklch(0.45 0.126 295 / 0.9)",
bloom: "oklch(0.45 0.14 295 / 0.28)",
},
},
mint: {
glow: {
core: "oklch(0.91 0.054 165)",
edge: "oklch(0.77 0.12 165 / 0.9)",
bloom: "oklch(0.7 0.12 165 / 0.55)",
},
ink: {
core: "oklch(0.32 0.084 165)",
edge: "oklch(0.45 0.108 165 / 0.9)",
bloom: "oklch(0.45 0.12 165 / 0.28)",
},
},
pearl: {
glow: {
core: "oklch(0.91 0 0)",
edge: "oklch(0.77 0 0 / 0.9)",
bloom: "oklch(0.7 0 0 / 0.55)",
},
ink: {
core: "oklch(0.32 0 0)",
edge: "oklch(0.45 0 0 / 0.9)",
bloom: "oklch(0.45 0 0 / 0.28)",
},
},
} satisfies Record<string, { glow: SeamFace; ink: SeamFace }>
type SeamColor = keyof typeof SEAM_COLORS
/** `auto` follows the color scheme: ink in light, glow in dark. */
type SeamTone = "auto" | "glow" | "ink"
// The faces land in per-tone variables; the classes below pick one per
// scheme. For a color of your own, set `--gs-light-*` and `--gs-dark-*`
// inline, or set `--gs-core`, `--gs-edge` and `--gs-bloom` inline to force
// one face in both schemes.
function seamVars(prefix: "gs" | "ss", color: SeamColor, tone: SeamTone) {
const c = SEAM_COLORS[color]
const light = tone === "glow" ? c.glow : c.ink
const dark = tone === "ink" ? c.ink : c.glow
return {
[`--${prefix}-light-core`]: light.core,
[`--${prefix}-light-edge`]: light.edge,
[`--${prefix}-light-bloom`]: light.bloom,
[`--${prefix}-dark-core`]: dark.core,
[`--${prefix}-dark-edge`]: dark.edge,
[`--${prefix}-dark-bloom`]: dark.bloom,
} as React.CSSProperties
}
/**
* A thin horizontal divider between sections: a rose line, brightest in the
* middle and fading out at both ends, with a soft blurred bloom around it.
* In dark mode it glows; in light mode it is a deeper rose ink.
*
* It is decorative, hidden from assistive tech, and spans the width of its
* container.
*/
function GlowSeam({
color = "rose",
tone = "auto",
className,
style,
...props
}: React.ComponentProps<"div"> & {
/** The named color; `rose` by default. See `SEAM_COLORS`. */
color?: SeamColor
/** `auto` follows the scheme; `glow` or `ink` forces one face. */
tone?: SeamTone
}) {
return (
<div
aria-hidden="true"
data-slot="glow-seam"
data-color={color}
className={cn(
"pointer-events-none relative h-0.5",
"[--gs-bloom:var(--gs-light-bloom)] [--gs-core:var(--gs-light-core)] [--gs-edge:var(--gs-light-edge)]",
"dark:[--gs-bloom:var(--gs-dark-bloom)] dark:[--gs-core:var(--gs-dark-core)] dark:[--gs-edge:var(--gs-dark-edge)]",
className
)}
style={{ ...seamVars("gs", color, tone), ...style }}
{...props}
>
<div
className="absolute inset-x-[6%] top-0 h-[1.5px]"
style={{
background:
"linear-gradient(90deg, transparent, var(--gs-edge) 38%, var(--gs-core) 52%, var(--gs-edge) 66%, transparent)",
}}
/>
<div
className="absolute inset-x-[12%] -top-1.75 h-3.75 blur-[9px] dark:mix-blend-screen"
style={{
background:
"radial-gradient(50% 100% at 50% 50%, var(--gs-bloom), transparent 75%)",
}}
/>
</div>
)
}
/**
* A vertical line of cool blue light that marks the active item, such as the
* selected tab. Like `GlowSeam`, it glows in dark mode and is a deeper ink in
* light mode. It is decorative and hidden from assistive tech.
*
* It is absolutely positioned with no size of its own: place it with
* `className`, for example `inset-y-0 left-0 w-3.5`, inside a positioned
* item. Inside a tab trigger it shows only while that tab is active.
*/
function StandingSeam({
color = "cyan",
tone = "auto",
className,
style,
...props
}: React.ComponentProps<"span"> & {
/** The named color; `cyan` by default. See `SEAM_COLORS`. */
color?: SeamColor
/** `auto` follows the scheme; `glow` or `ink` forces one face. */
tone?: SeamTone
}) {
return (
<span
aria-hidden="true"
data-slot="standing-seam"
data-color={color}
className={cn(
// In a tab trigger it lights only the active one.
"pointer-events-none absolute in-data-[slot=tabs-trigger]:opacity-0 in-data-[slot=tabs-trigger]:in-data-active:opacity-100",
"[--ss-bloom:var(--ss-light-bloom)] [--ss-core:var(--ss-light-core)] [--ss-edge:var(--ss-light-edge)]",
"dark:[--ss-bloom:var(--ss-dark-bloom)] dark:[--ss-core:var(--ss-dark-core)] dark:[--ss-edge:var(--ss-dark-edge)]",
className
)}
style={{ ...seamVars("ss", color, tone), ...style }}
{...props}
>
<span
className="absolute inset-y-2 left-0 w-[1.5px]"
style={{
background:
"linear-gradient(180deg, transparent, var(--ss-edge) 30%, var(--ss-core) 50%, var(--ss-edge) 70%, transparent)",
}}
/>
<span
className="absolute inset-y-1 -left-1.5 w-3.5 blur-[7px] dark:mix-blend-screen"
style={{
background:
"radial-gradient(50% 60% at 50% 50%, var(--ss-bloom), transparent 78%)",
}}
/>
</span>
)
}
export { GlowSeam, StandingSeam, SEAM_COLORS }
export type { SeamColor, SeamTone }
import type { ComponentProps } from "react"
import { cva, type VariantProps } from "class-variance-authority"
import { cn } from "cn"
import { Grid, type GridProps } from "@/components/grid/grid"
/**
* A list of `Stat` items laid out by `Grid`, rendered as a `ul`. It defaults
* to 3 columns and the large gap. Like `Grid`, its columns follow the width
* it is given, so size its parent to narrow it. `className` lands on the
* list.
*/
function StatGroup({
cols = 3,
gap = "lg",
...props
}: ComponentProps<"ul"> & {
/**
* The most columns, 3 by default. They step up as the list's space
* widens, the way `Grid`'s do.
*/
cols?: GridProps["cols"]
/**
* Space between stats: `xs` 8px, `sm` 16px, `md` 24px, `lg` 40px, `xl` 64px, `px` 1px, `none` 0. `lg`
* is the default.
*/
gap?: GridProps["gap"]
}) {
return (
<Grid
data-slot="stat-group"
render={<ul role="list" />}
cols={cols}
gap={gap}
// Grid's props are typed for its default div; this group renders a list.
{...(props as Omit<GridProps, "cols" | "gap">)}
/>
)
}
// card sets the stat on a filled panel; rule sets a line down its left side.
const statVariants = cva("grid content-start gap-2", {
variants: {
/**
* The stat style. `default` (the default) adds nothing. `card` sets it
* on a `rounded-xl` panel with 32px padding, filled with `muted`, or
* with `card` and `card-foreground` text in dark mode. `rule` draws a
* 1px line in `border` down its left side, 24px from the text.
*/
variant: {
default: "",
card: "rounded-xl bg-muted p-8 dark:bg-card dark:text-card-foreground",
rule: "border-l border-border pl-6",
},
},
defaultVariants: { variant: "default" },
})
/**
* One figure and its label, as an `li` inside `StatGroup`. Holds a
* `StatValue` and a `StatLabel`, stacked with 8px gaps.
*
* `card` sets it on a filled, rounded panel with 32px padding. `rule` draws a
* line down its left side.
*/
function Stat({
className,
variant = "default",
...props
}: ComponentProps<"li"> & VariantProps<typeof statVariants>) {
return (
<li
data-slot="stat"
data-variant={variant}
className={cn(statVariants({ variant }), className)}
{...props}
/>
)
}
/** The figure itself, such as a number or a percentage, at 32px in the body font. */
function StatValue({ className, ...props }: ComponentProps<"p">) {
return (
<p
data-slot="stat-value"
className={cn("text-[2rem]/10 tracking-tight", className)}
{...props}
/>
)
}
/**
* The caption under the figure: what it measures, in a few words. Small
* muted text, 14px on a 20px line, so the number carries the weight. Longer
* explanation belongs in the section's lead or a note, not here.
*/
function StatLabel({ className, ...props }: ComponentProps<"p">) {
return (
<p
data-slot="stat-label"
className={cn("text-sm/5 text-pretty text-muted-foreground", className)}
{...props}
/>
)
}
export { StatGroup, Stat, StatValue, StatLabel }
import { mergeProps } from "@base-ui/react/merge-props"
import { useRender } from "@base-ui/react/use-render"
import { cva, type VariantProps } from "class-variance-authority"
import { cn } from "cn"
const GRID_DEFAULTS = { cols: 3, gap: "lg" } as const
const containerGridVariants = cva("grid w-full grid-cols-1", {
variants: {
/**
* The most columns. Below 40rem of screen width the grid is one
* column (two for `6`); it steps up at 40rem and 48rem: `2` is two
* columns from 40rem, `3` two then three, `4` two then four, `5` three
* then five, and `6` three, then four, then six from 64rem. The default
* is 3.
*/
cols: {
1: "",
2: "sm:grid-cols-2",
3: "sm:grid-cols-2 md:grid-cols-3",
4: "sm:grid-cols-2 md:grid-cols-4",
5: "sm:grid-cols-3 md:grid-cols-5",
6: "grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-6",
},
/**
* Space between items: `xs` 8px, `sm` 16px, `md` 24px, `lg` 40px, `xl` 64px, `px` 1px, `none` 0. `lg`
* is the default. The sizes are the `--gap-*` values in globals.css.
*/
gap: {
xs: "gap-(--gap-xs)",
sm: "gap-(--gap-sm)",
md: "gap-(--gap-md)",
lg: "gap-(--gap-lg)",
xl: "gap-(--gap-xl)",
px: "gap-px",
none: "gap-0",
},
},
defaultVariants: GRID_DEFAULTS,
})
type GridState = { slot: "grid" } & VariantProps<typeof containerGridVariants>
type GridProps = useRender.ComponentProps<"div", GridState> &
VariantProps<typeof containerGridVariants>
/**
* Columns follow the screen, stepping at 40rem and 48rem (and 64rem for six).
* Gap sizes read the shared `--gap-*` values in globals.css. The grid fills
* its parent's width: without that, a grid given `mx-auto` or set inside a
* centering parent shrinks to fit its content, and a part built on it that
* is a container collapses to nothing.
*
* className, render and every other prop go to the grid. To narrow a Grid, pass
* a `max-w-*` class or size its parent.
*/
function Grid({
className,
cols = GRID_DEFAULTS.cols,
gap = GRID_DEFAULTS.gap,
render,
...props
}: GridProps) {
const grid = useRender({
defaultTagName: "div",
render,
state: { slot: "grid", cols, gap },
props: mergeProps<"div">(
{ className: cn(containerGridVariants({ cols, gap }), className) },
props
),
})
return grid
}
export { Grid, type GridProps }
import { mergeProps } from "@base-ui/react/merge-props"
import { useRender } from "@base-ui/react/use-render"
import { cva, type VariantProps } from "class-variance-authority"
import { cn } from "cn"
// No width of its own: the SectionHeader column (or whatever holds it) is
// the measure. text-pretty keeps a wrapped title from ending on one word.
// font-display follows font-sans unless the block switches it, for example
// with [--font-display:var(--font-serif)].
const subheadingVariants = cva(
"font-display font-[450] tracking-[-0.05em] text-pretty sm:tracking-[-0.06em]",
{
variants: {
/**
* `default` inherits the surrounding display face. `serif` uses
* the kit's serif role, without changing the surrounding font.
*/
variant: {
default: "",
serif: "[--font-display:var(--font-serif)]",
},
/**
* `md` (the default): 32px/40px, capped at 40px/44px from `sm`.
* `lg`: 32px/40px, 40px/48px from `sm`, 48px/56px from `lg`.
* `xl`: 32px/40px, 48px/56px from `sm`, 56px/56px from `lg`.
*/
size: {
md: "text-[2rem]/10 sm:text-[2.5rem]/11",
lg: "text-[2rem]/10 sm:text-[2.5rem]/12 lg:text-5xl/14",
xl: "text-[2rem]/10 sm:text-5xl/14 lg:text-[3.5rem]/14",
},
},
defaultVariants: { variant: "default", size: "md" },
}
)
/**
* The section heading in the display font, which follows `font-sans`
* unless a block switches that role. Rendered as an `<h2>` at weight 450.
* The default `size="md"` steps
* from 32px/40px to 40px/44px at `sm` and stays there. Choose `size="lg"`
* for 32px/40px, 40px/48px at `sm` and 48px/56px at `lg`, or `size="xl"`
* for 32px/40px, 48px/56px at `sm` and 56px/56px at `lg`.
* `variant="serif"` uses the kit's serif role; the default keeps the
* surrounding display face. Both variants support all three sizes.
* Pass `render` to use another heading level. A page's headline is `Heading`.
*/
function Subheading({
className,
variant = "default",
size = "md",
render,
...props
}: useRender.ComponentProps<"h2"> & VariantProps<typeof subheadingVariants>) {
return useRender({
defaultTagName: "h2",
render,
state: { slot: "subheading", variant, size },
props: mergeProps<"h2">(
{
className: cn(subheadingVariants({ variant, size }), className),
},
props
),
})
}
export { Subheading, subheadingVariants }
import { mergeProps } from "@base-ui/react/merge-props"
import { useRender } from "@base-ui/react/use-render"
import { cva, type VariantProps } from "class-variance-authority"
import { cn } from "cn"
// Paragraphs in introductions and body content. The layout owns the text
// measure: give it a `max-w-*` class when needed. Inherits the surrounding
// ink, so it reads over art; muted steps it down on a flat ground.
const textVariants = cva("w-full min-w-0 text-pretty", {
variants: {
/**
* The text color. `default` (the default) keeps the inherited color.
* `muted` uses `muted-foreground`.
*/
variant: {
default: "",
muted: "text-muted-foreground",
},
/**
* The text size: `md` (the default) 16px/28px for body copy; `lg`
* 18px/28px for an introduction; `xl` 18px/28px, then 20px/32px from
* `sm` for a hero introduction.
*/
size: {
md: "text-base/7",
lg: "text-lg/7",
xl: "text-lg/7 sm:text-xl/8",
},
},
defaultVariants: { variant: "default", size: "md" },
})
/**
* A paragraph in an introduction or body content, a `p` by default. For
* several paragraphs, pass `render={<div />}` and put your own `p` elements
* inside.
*
* `size` sets the text: `md` (the default) 16px/28px, `lg` 18px/28px, or
* `xl` 18px/28px and 20px/32px from `sm` for a hero. The layout controls
* the text's width and spacing. `variant="muted"`
* uses the muted text color; the default inherits the ink around it.
*/
function Text({
className,
variant = "default",
size = "md",
render,
...props
}: useRender.ComponentProps<"p"> & VariantProps<typeof textVariants>) {
return useRender({
defaultTagName: "p",
render,
state: { slot: "text", variant, size },
props: mergeProps<"p">(
{ className: cn(textVariants({ variant, size }), className) },
props
),
})
}
export { Text, textVariants }
Installation
pnpm dlx shadcn@latest add @01orbital/stats-horizon-01npx shadcn@latest add @01orbital/stats-horizon-01yarn dlx shadcn@latest add @01orbital/stats-horizon-01bunx --bun shadcn@latest add @01orbital/stats-horizon-01Make it yours
- Its words are in
COPYat the top ofcomponents/blocks/stats/stats-horizon-01/index.tsx: change them there, not in the markup. STATS, also at the top of the file, holds its lists and settings.- Its look comes from Glow Seam; each page lists the props that change it.
Built from
npm: @01orbital/font-geist-serif. The CLI installs it for you.
Built from these parts. The CLI adds each one that is missing and won't replace a file you already have unless you choose to:
Last updated on