Skip to content

Agentic design system

The tokens and components this site is built from. Token values and usage counts are read from the code every time the site is built. Component rules live in lib/designSystem/components.ts, and a check fails when a component is missing from it.

Primitives
31
Semantic colours
55
Tokens in all
238
Components
34

Rules for agents

What a coding agent working in this repository must follow. The guards script and oxlint check the ones a machine can see.

  1. Colour comes from a semantic role, never a primitive, never a Tailwind palette colour, never a hex value.
  2. No arbitrary values in square brackets in a class name. A missing value becomes a token in app/globals.css first.
  3. Lengths are rem, breakpoints em. px only for hairlines and the focus outline width.
  4. Padding, margin and gap use a spacing role (tight, inline, stack, group, card, block, section, pageTop, gutter, bleed), never a number. Sizes (w, h, size) stay numeric.
  5. Every text and background pair reaches 4.5:1, controls and focus 3:1.
  6. Motion uses the motion tokens only. They drop to 0ms under prefers-reduced-motion.
  7. Accent is for the action. Headlines carry hierarchy through size, weight and colour level.
  8. Token and class names are camelCase.
  9. Actions use the Button component. A raw button tag fails the guard unless the file is a written exception (a calendar day, a sortable header, a demo control).
  10. Headings go through the Heading component (or DisplayHeading, Subheading). A raw h1 to h6 tag fails the guard.
  11. An exception to a rule is written down in lib/designSystem/ruleExceptions.json with the reason, never added silently.

Exceptions

Every rule can have an exception, but only a written one: the file, the rule it skips and why. The guards script reads this list, so an exception that is not here fails the check.

  • noRawHexcomponents/home/heroRulesDemo.module.csssince 2026-11-23

    The Without rules screen of the hero demo is off-brand on purpose: it shows what an agent builds when it has no rules. The only place on the site where raw colours are the point.

  • noRawHexcomponents/article/sameMistakes/sameMistakes.module.csssince 2026-11-23

    The dark diff panel in the Same mistakes post uses its own red and green for removed and added lines, scoped to that one figure.

  • noRawHexcomponents/services/behindThePrompt/uiGeneration.csssince 2026-11-23

    The generation animation on the service page draws a neutral wireframe in its own cool greys, separate from the site palette.

  • noRawHexcomponents/for/since 2026-11-23

    For pages rebuild another company's product in that company's own brand, with its own palette.

  • rawHeadingcomponents/for/since 2026-11-23

    For pages rebuild another company's product with its own type, not the site's headings.

  • rawButtoncomponents/for/since 2026-11-23

    For pages rebuild another company's product with its own controls.

  • rawButtoncomponents/analytics/since 2026-11-23

    Custom controls in the private analytics dashboard: tabs, sortable table headers, calendar days, metric toggles. The Button cannot be any of these.

  • rawButtoncomponents/article/stateSwitch/since 2026-11-23

    The switches inside the Every state on one screen demo are part of the product being shown.

  • rawButtoncomponents/home/HeroRulesDemo.tsxsince 2026-11-23

    The Without rules / With rules segmented toggle and the demo's own controls.

  • rawButtoncomponents/designSystem/DsNav.tsxsince 2026-11-23

    The collapsible group headers of the design system sidebar are disclosure controls, not actions.

  • rawSpacingcomponents/for/since 2026-11-24

    For pages rebuild another company's product with that company's own spacing scale.

Primitives

Raw values. Components never use these directly; a semantic role points at them.

Neutral

Warm greys. Every surface, text and border on the site.

  • --neutral50#faf9f5Used by 3
  • --neutral100#f4f3eeUsed by 5
  • --neutral150#e6e4ddUsed by 6
  • --neutral175#e0ded6Used by 1
  • --neutral200#dad8d0Used by 2
  • --neutral300#b3b1a9Used by 1
  • --neutral400#7a7872Used by 1
  • --neutral600#62615cUsed by 1
  • --neutral800#3a3936Used by 2
  • --neutral850#1c1c1bUsed by 1
  • --neutral900#171716Used by 9

Royal violet

The accent and the chart line.

  • --royalViolet600#5224dbUsed by 3
  • --royalViolet700#481fc1Used by 1
  • --royalViolet200#c9bdfaUsed by 1

Green

Positive values and code values.

  • --green500#2da44eUsed by 1
  • --green700#1a7f37Not used by a role
  • --green800#176f30Used by 2
  • --green300#98c379Used by 1

Red

Negative values.

  • --red700#b42318Used by 2

Coral

Code keys.

  • --coral400#fd815dUsed by 1

Ember

The dark demo chrome and the hero wave.

  • --emberInk#14131aUsed by 1
  • --emberOrange#ff6b3dUsed by 1
  • --emberViolet#7a5cffUsed by 1
  • --emberInk700#34323dUsed by 2
  • --emberInk750#25232cUsed by 2
  • --emberInk800#22212aUsed by 1
  • --emberInk825#1c1b23Used by 2
  • --emberInk900#18171fUsed by 1

Window controls

The three dots on a window mock-up.

  • --macosRed#ff5f57Used by 1
  • --macosYellow#febc2eUsed by 1
  • --macosGreen#28c840Used by 1

Semantic colours

The names components use. Change a primitive behind a role and every component follows.

Page and surfaces

The ground everything sits on, and the text that sits on it.

  • --background

    The page itself.

    #f4f3ee ← --neutral100
    11 filesbg-background (7)
  • --foreground

    Body text and headings on the page.

    #171716 ← --neutral900
    20 filesbg-foreground (2) · text-foreground (13) · border-foreground (1) · outline-foreground (3)
  • --surface

    A raised card or panel on the page.

    #faf9f5 ← --neutral50
    23 filesbg-surface (18) · fill-surface (1)
  • --sunken

    A recessed band, a step darker than the page.

    #e0ded6 ← --neutral175
    5 filesbg-sunken (4)
  • --muted

    Quiet fills: chips, inactive tracks, hover rows.

    #e6e4dd ← --neutral150
    6 filesbg-muted (4)
  • --mutedForeground

    Secondary text: captions, meta lines, placeholders.

    #62615c ← --neutral600
    45 filestext-mutedForeground (40) · fill-mutedForeground (1)
  • --tableHeader

    The header row of a data table.

    #e6e4dd ← --neutral150
    3 filesbg-tableHeader (3)
  • --skeleton

    Loading placeholders.

    #e6e4dd ← --neutral150
    2 files
  • --mediaBackdrop

    Behind an image or video while it loads.

    #dad8d0 ← --neutral200
    1 filebg-mediaBackdrop (1)
  • --overlayImageHover

    The dim layer over an image on hover.

    #17171659 ← color-mix(in srgb, var(--neutral900) 35%, transparent)
    1 filebg-overlayImageHover (1)

Borders and focus

Lines and the focus ring. A border that marks a control must reach 3:1.

  • --border

    Hairlines between content. Decorative, not a control edge.

    #dad8d0 ← --neutral200
    25 filesborder-border (18) · divide-border (1) · ring-border (1) · stroke-border (1)
  • --borderStrong

    The edge of a control: inputs, outline buttons.

    #7a7872 ← --neutral400
    7 filestext-borderStrong (1) · border-borderStrong (2) · stroke-borderStrong (1)
  • --ring

    The keyboard focus ring.

    #171716 ← --neutral900
    3 filesoutline-ring (2)

Actions

Accent means action, nothing else. Never on taglines or headline words.

  • --primary

    The one main action of a view.

    #171716 ← --neutral900
    6 filesbg-primary (5)
  • --primaryForeground

    Label on a primary action.

    #f4f3ee ← --neutral100
    7 filestext-primaryForeground (5)
  • --primaryHover

    Primary action on hover.

    #3a3936 ← --neutral800
    1 filebg-primaryHover (1)
  • --secondary

    An action next to the primary one.

    #faf9f5 ← --neutral50
    2 filesbg-secondary (2)
  • --secondaryForeground

    Label on a secondary action.

    #171716 ← --neutral900
    1 filetext-secondaryForeground (1)
  • --secondaryHover

    Secondary action on hover.

    #e6e4dd ← --neutral150
    6 filesbg-secondaryHover (6)
  • --accent

    The violet call to action.

    #5224db ← --royalViolet600
    6 filesbg-accent (3)
  • --accentForeground

    Label on the accent.

    #f4f3ee ← --neutral100
    6 filestext-accentForeground (3)
  • --accentHover

    Accent on hover.

    #481fc1 ← --royalViolet700
    3 filesbg-accentHover (1)

Inverse

Dark bands inside the light page. The toneInverse utility swaps these in.

  • --inverse

    A dark band.

    #1c1c1b ← --neutral850
    6 filesbg-inverse (4)
  • --inverseForeground

    Text on a dark band.

    #f4f3ee ← --neutral100
    9 filestext-inverseForeground (4)
  • --inverseMutedForeground

    Secondary text on a dark band.

    #b3b1a9 ← --neutral300
    4 files
  • --inverseBorder

    Hairlines on a dark band.

    #3a3936 ← --neutral800
    2 files
  • --inverseRing

    Focus ring on a dark band.

    #f4f3ee ← --neutral100
    2 files
  • --selection

    Selected text background.

    #1c1c1b ← --inverse
    Only in globals.css
  • --selectionForeground

    Selected text.

    #f4f3ee ← --inverseForeground
    Only in globals.css

Status

Good and bad numbers. A tint is a background under the matching text colour.

  • --success

    A completed state indicator.

    #2da44e ← --green500
    1 file
  • --positive

    A number that went the right way.

    #176f30 ← --green800
    3 filestext-positive (2)
  • --positiveTint

    Background under positive text.

    #176f301f ← color-mix(in srgb, var(--green800) 12%, transparent)
    2 filesbg-positiveTint (1)
  • --negative

    A number that went the wrong way.

    #b42318 ← --red700
    3 filestext-negative (2)
  • --negativeTint

    Background under negative text.

    #b423181a ← color-mix(in srgb, var(--red700) 10%, transparent)
    2 filesbg-negativeTint (1)

Data

Charts in the analytics dashboard.

  • --chartLine

    The line of a trend chart.

    #5224db ← --royalViolet600
    1 filestroke-chartLine (1)
  • --chartArea

    The area under the trend line.

    #5224db1f ← color-mix(in srgb, var(--royalViolet600) 12%, transparent)
    1 filefill-chartArea (1)
  • --barFill

    A bar in a bar list.

    #efede8 ← color-mix(in srgb, var(--neutral150) 55%, var(--neutral50))
    1 filebg-barFill (1)
  • --barFillActive

    A bar under the pointer.

    #e6e4dd ← --neutral150
    2 filesbg-barFillActive (2)

Code

Syntax colours inside dark code panels.

  • --codeToken

    A token name in code.

    #c9bdfa ← --royalViolet200
    1 file
  • --codeKey

    A key or property name.

    #fd815d ← --coral400
    2 filestext-codeKey (2)
  • --codeValue

    A value.

    #98c379 ← --green300
    2 filestext-codeValue (2)

Demo chrome

The dark windows, terminals and the hero wave. Only for demos, never for site UI.

  • --waveBase

    The hero wave background.

    #14131a ← --emberInk
    2 files
  • --waveMain

    The main wave colour.

    #ff6b3d ← --emberOrange
    2 files
  • --waveCompanion

    The second wave colour.

    #7a5cff ← --emberViolet
    2 files
  • --demoChrome

    A demo window frame.

    #1c1b23 ← --emberInk825
    1 file
  • --demoChromeRaisedTop

    Top of a raised control in a demo window.

    #34323d ← --emberInk700
    1 file
  • --demoChromeRaisedBottom

    Bottom of a raised control in a demo window.

    #25232c ← --emberInk750
    1 file
  • --demoCardTop

    Top of a card gradient in a demo window.

    #22212a ← --emberInk800
    2 files
  • --demoCardBottom

    Bottom of a card gradient in a demo window.

    #18171f ← --emberInk900
    2 files
  • --terminal

    A terminal window.

    #1c1b23 ← --emberInk825
    1 file
  • --terminalBar

    The title bar of a terminal.

    #25232c ← --emberInk750
    1 file
  • --terminalBorder

    The edge of a terminal.

    #34323d ← --emberInk700
    1 file
  • --windowControlClose

    Close dot.

    #ff5f57 ← --macosRed
    1 file
  • --windowControlMinimize

    Minimise dot.

    #febc2e ← --macosYellow
    1 file
  • --windowControlZoom

    Zoom dot.

    #28c840 ← --macosGreen
    1 file

Contrast

Each pair measured from the resolved values. Text needs 4.5:1, controls and focus 3:1 (WCAG 2.2 AA).

Contrast of each foreground and background pair, against the WCAG 2.2 AA minimum
SampleForeground on backgroundRatioAA
--foreground on --background16.15:1Pass (4.5:1 text)
--foreground on --surface17.03:1Pass (4.5:1 text)
--mutedForeground on --background5.59:1Pass (4.5:1 text)
--mutedForeground on --surface5.89:1Pass (4.5:1 text)
--mutedForeground on --muted4.88:1Pass (4.5:1 text)
--mutedForeground on --sunken4.61:1Pass (4.5:1 text)
--foreground on --tableHeader14.10:1Pass (4.5:1 text)
--primaryForeground on --primary16.15:1Pass (4.5:1 text)
--primaryForeground on --primaryHover10.39:1Pass (4.5:1 text)
--secondaryForeground on --secondary17.03:1Pass (4.5:1 text)
--accentForeground on --accent7.18:1Pass (4.5:1 text)
--accentForeground on --accentHover8.43:1Pass (4.5:1 text)
--inverseForeground on --inverse15.35:1Pass (4.5:1 text)
--inverseMutedForeground on --inverse7.94:1Pass (4.5:1 text)
--selectionForeground on --selection15.35:1Pass (4.5:1 text)
--positive on --positiveTint5.00:1Pass (4.5:1 text)
--negative on --negativeTint5.30:1Pass (4.5:1 text)
--borderStrong on --background3.97:1Pass (3:1 ui)
--borderStrong on --surface4.19:1Pass (3:1 ui)
--ring on --background16.15:1Pass (3:1 ui)
--inverseRing on --inverse15.35:1Pass (3:1 ui)
--chartLine on --surface7.57:1Pass (3:1 ui)

Typography

Families and the type scale. The badge counts the files that use each size.

Families

  • --fontDisplayvar(--fontSchibsted), var(--fontSchibstedExt)var(--fontDisplay)

    Áá Őő Űű 0123456789

  • --fontBodyvar(--fontSchibsted), var(--fontSchibstedExt)var(--fontBody)

    Áá Őő Űű 0123456789

  • --fontCodevar(--fontFragment), var(--fontFragmentExt)var(--fontCode)

    Áá Őő Űű 0123456789

Scale

  • --text-xs0.75remtext-xs8 files

    Design that agents can build from

    line height 1rem
  • --text-sm0.875remtext-sm35 files

    Design that agents can build from

    line height 1.25rem
  • --text-base1remtext-base12 files

    Design that agents can build from

    line height 1.625rem
  • --text-lg1.125remtext-lg10 files

    Design that agents can build from

    line height 1.75rem
  • --text-xl1.25remtext-xl7 files

    Design that agents can build from

    line height 1.875rem
  • --text-2xl1.5remtext-2xl1 file

    Design that agents can build from

    line height 2rem
  • --text-3xl1.875remtext-3xl3 files

    Design that agents can build from

    line height 2.375rem
  • --text-4xl2.25remtext-4xl2 files

    Design that agents can build from

    line height 2.75rem
  • --text-6xl3.75remtext-6xl2 files

    Design that agents can build from

    line height 4.25rem
  • --text-articleHeadingclamp(1.5rem, 1.25rem + 1vw, 1.875rem)text-articleHeading1 file

    Design that agents can build from

    line height 1.25 · tracking -0.025em
  • --text-articleTitleclamp(2.25rem, 1.5rem + 3vw, 3.75rem)text-articleTitle1 file

    Design that agents can build from

    line height 1.12 · tracking -0.025em
  • --text-subheadingclamp(1.125rem, 0.9rem + 1vw, 1.5rem)text-subheading2 files

    Design that agents can build from

    line height 1.2 · tracking -0.01em
  • --text-sectionTitleclamp(1.5rem, 1.1rem + 1.6vw, 2rem)text-sectionTitle1 file

    Design that agents can build from

    line height 1.05 · tracking -0.02em
  • --text-heroTitleclamp(2.75rem, 2.4rem + 1.45vw, 3.5rem)text-heroTitle1 file

    Design that agents can build from

    line height 1 · tracking -0.04em
  • --text-displaySmclamp(2.5rem, 1.4rem + 4.8vw, 5.5rem)text-displaySm1 file

    Design that agents can build from

    line height 0.95 · tracking -0.04em
  • --text-displayclamp(2.875rem, 0.5rem + 11vw, 12rem)text-display1 file

    Design that agents can build from

    line height 0.9 · tracking -0.05em

Radius

  • --radius-sm0.25rem11 files
  • --radius-md0.5rem8 files
  • --radius-lg0.75rem7 files
  • --radius-xl1rem3 files
  • --radius-2xl1.5rem12 files
  • --radius-3xl2rem1 file
  • --radius-pill999px5 files
  • --radius-media1.25rem7 files
  • --radius-buttonvar(--buttonRadius)3 files

Spacing

Every padding, margin and gap outside components/ui uses one of these names; a number fails the rawSpacing guard. The larger ones grow with the screen, so no breakpoint pairs. The bar shows the value at this window width.

  • --spacing-tight0.25remgap-tight, p-tight, mt-tight12 files

    Text and its small companion text: a step title and its line, a date and a title.

  • --spacing-inline0.5remgap-inline, p-inline, mt-inline19 files

    Small things side by side: icon and label, label and field, title and text in a card.

  • --spacing-stack1remgap-stack, p-stack, mt-stack31 files

    Items of one list or form: cards in a list, fields, list rows.

  • --spacing-group1.5remgap-group, p-group, mt-group27 files

    Groups inside one section: paragraphs, a subheading and its text.

  • --spacing-cardclamp(1.5rem, 1.27rem + 0.91vw, 2rem)gap-card, p-card, mt-card4 files

    The inner edge of a card or panel.

  • --spacing-blockclamp(2.5rem, 1.82rem + 2.73vw, 4rem)gap-block, p-block, mt-block17 files

    Large units inside a page: sections of a post or service page, case study blocks, footer columns.

  • --spacing-sectionclamp(3rem, 0.73rem + 9.09vw, 8rem)gap-section, p-section, mt-section7 files

    Top and bottom of a home page section, and the end of a page.

  • --spacing-pageTopclamp(4rem, 3.09rem + 3.64vw, 6rem)gap-pageTop, p-pageTop, mt-pageTop4 files

    Between the site header and the title of a page.

  • --spacing-gutterclamp(1.25rem, 0.68rem + 2.27vw, 2.5rem)gap-gutter, p-gutter, mt-gutter1 file

    The two side edges of the page. Only Container uses it.

  • --spacing-bleed8remgap-bleed, p-bleed, mt-bleed2 files

    How far a wide figure or table reaches past the reading column on large screens.

  • --spacing-sectionTitleGapclamp(1.5rem, 0.5rem + 3vw, 2.5rem)gap-sectionTitleGap, p-sectionTitleGap, mt-sectionTitleGap3 files

    Gap under a section title. Tailwind: mb-sectionTitleGap.

Containers

Maximum widths for reading and layout.

  • --container-article42remmax-w-article9 files
  • --container-content56remmax-w-content6 files
  • --container-page76remmax-w-page1 file

Shadows

  • --shadowWindow0 1.5rem 3rem -1.5rem color-mix(in srgb, var(--neutral900) 25%, transparent)
  • --shadowTerminal0 1.5rem 3rem -1.5rem color-mix(in srgb, var(--neutral900) 45%, transparent)
  • --shadowCardHover0 0.5rem 1rem -0.5rem color-mix(in srgb, var(--neutral900) 30%, transparent)
  • --shadowCursor0 0.125rem 0.25rem color-mix(in srgb, var(--neutral900) 35%, transparent)

Motion

Durations drop to 0ms when the visitor asks for reduced motion.

Durations

  • --motionDurationFast120msvar(--motionDurationFast)
    reduced motion: 0ms
  • --motionDurationBase200msvar(--motionDurationBase)
    reduced motion: 0ms
  • --motionDurationSlow400msvar(--motionDurationSlow)
    reduced motion: 0ms
  • --motionDurationReveal300msvar(--motionDurationReveal)
    reduced motion: 0ms
  • --motionDurationScroll1100msvar(--motionDurationScroll)
    reduced motion: 0ms
  • --motionDurationMorph600msvar(--motionDurationMorph)
    reduced motion: 0ms

Easing

  • --motionEaseStandardcubic-bezier(0.2, 0, 0, 1)
  • --motionEaseOutcubic-bezier(0.23, 1, 0.32, 1)
  • --motionEaseScrollcubic-bezier(0.25, 0.1, 0.25, 1)
  • --motionEaseTravelcubic-bezier(0.45, 0, 0.1, 1)

Other values

Single-purpose values: optical offsets, focus ring, page-specific sizes.

  • --buttonRadius0.75remvar(--buttonRadius)

    Corner of every button and input. Tailwind: rounded-button.

  • --diagramViewportHeight32remvar(--diagramViewportHeight)

    Height of the diagram window on the service page.

  • --dsNavWidth16remvar(--dsNavWidth)

    Width of the navigation on this page.

  • --forNavHeight4.5remvar(--forNavHeight)

    Height of the navigation on a For page.

  • --forStoryWidth36remvar(--forStoryWidth)

    Reading width of a For page story.

  • --forChapterMinHeight32remvar(--forChapterMinHeight)

    Minimum height of a For page chapter.

  • --portraitZoom1.5var(--portraitZoom)

    How far the About portrait is zoomed.

  • --portraitOriginX40%var(--portraitOriginX)

    Horizontal anchor of the portrait zoom.

  • --portraitOriginY100%var(--portraitOriginY)

    Vertical anchor of the portrait zoom.

  • --displayOpticalOffsetStem-0.09emvar(--displayOpticalOffsetStem)

    Pulls a display heading left when it starts with a straight stem (H, I, L).

  • --displayOpticalOffsetRound-0.045emvar(--displayOpticalOffsetRound)

    The same for a round start (C, O, S).

  • --displayOpticalOffsetDiagonal-0.02emvar(--displayOpticalOffsetDiagonal)

    The same for a diagonal start (A, V, W).

  • --iconCapHeight0.75emvar(--iconCapHeight)

    An inline icon the height of a capital letter.

  • --focusRingWidth2pxvar(--focusRingWidth)

    Width of the focus outline. Stays px: a hairline must stay a hairline.

  • --focusRingOffset2pxvar(--focusRingOffset)

    Gap between the element and its focus outline.

Controls

Components in components/ui. The badge counts the files that use each one.

Button

10 files
components/ui/button.tsx

Every clickable action on the site. A link that looks like a button uses asChild.

Variants

Sizes and icons

Hover

Keyboard focus

Disabled

When to use. Variant follows the role: primary or accent is the one action the view is about, secondary or outline sits next to it, ghost is a tool inside a dense component, link sends the reader somewhere from inside a section.

Do

  • One primary or accent action per view.
  • Icon before the label; only a directional arrow trails it.
  • asChild with a Link when the button navigates.
  • disabled for an action that is not available yet.

Don't

  • Two accent buttons side by side.
  • uppercase, normal-case or capitalize on a Button: the case lives in the component (guard buttonCaseFromComponent).
  • A bare <button> styled by hand next to the library.
  • Lower opacity to mean disabled on an enabled button.

Names, types and defaults read from components/ui/button.tsx at build time.

Props of Button
PropTypeDefaultWhat it does
variant"link" | "primary" | "accent" | "secondary" | "outline" | "ghost" | null"primary"The role of the action.
size"md" | "sm" | "icon" | "inline" | null"md"md in content, sm in dense rows, icon for an icon-only action, inline inside text.
asChildbooleanfalseRenders the child (a Link) with the button styles.
...<button>–Every native <button> attribute. className only for layout: margin, width, grid placement.

Accessibility

  • The visible label is the name; size icon needs an aria-label.
  • Focus ring from the global :focus-visible rule, 2px, 3:1 against the page.
  • md and sm sizes reach 2.75rem, the touch target minimum.

Input

3 files
components/ui/input.tsx

A single-line text field.

With a visible label

Hover

Keyboard focus

Filled and disabled

When to use. Every text, email or search field. A visible label sits above it, or a visually hidden one when an icon and placeholder make the purpose plain.

Do

  • A <label> tied to the field with htmlFor.
  • type and autoComplete that match the data.
  • Leave room with pl or pr when an icon or key hint sits inside.

Don't

  • A placeholder as the only label.
  • A hand-styled <input> next to this one; for a <textarea> use Textarea.
  • Removing the outline or the hover border.

Names, types and defaults read from components/ui/input.tsx at build time.

Props of Input
PropTypeDefaultWhat it does
leadingIconbooleanfalseRoom for an icon placed at the start of the field.
trailingHintbooleanfalseRoom for a shortcut hint placed at the end of the field.
...<input>–Every native input attribute, including ref. className only for layout: margin, width, grid placement.

Accessibility

  • Border is borderStrong, 3:1 against the surface; hover and focus darken it to foreground.
  • Focus shows a 2px ring 2px outside the border; a scrolling parent needs room for it.
  • Caret is the foreground colour.

Textarea

1 file
components/ui/textarea.tsx

A multi-line text field with the same states as Input.

With a visible label

Hover and keyboard focus

When to use. A message or a longer answer. Same border, hover, focus and caret as Input, from one shared class.

Do

  • A <label> tied to it with htmlFor.
  • rows for the expected length.

Don't

  • A hand-styled <textarea>.
  • Letting it resize: it is fixed, so the layout below never jumps.

Names, types and defaults read from components/ui/textarea.tsx at build time.

Props of Textarea
PropTypeDefaultWhat it does
...<textarea>–Every native textarea attribute. className only for layout: margin, width, grid placement.

Accessibility

  • Same border contrast, hover and focus ring as Input.

Popover

1 file
components/ui/popover.tsx

A small panel that opens from a trigger and stays until dismissed.

Click the trigger

When to use. Extra controls or detail that belong to one trigger, such as a date range picker. Popover, PopoverTrigger and PopoverContent are used together.

Do

  • PopoverTrigger asChild around a Button.
  • Content that can be read and used with the keyboard.

Don't

  • A whole form or a page of text in a popover.
  • Opening it on hover: use Tooltip for a hint.

Names, types and defaults read from components/ui/popover.tsx at build time.

Props of Popover
PropTypeDefaultWhat it does
PopoverContent.sideOffsetnumber8PopoverContent: gap from the trigger in px.
PopoverContent.align"center" | "start" | "end""start"PopoverContent: edge of the trigger it lines up with.
PopoverContent...Radix Popover.Content–Every Radix Popover.Content prop. className only for layout: margin, width, grid placement.

Accessibility

  • Radix moves focus into the content and back to the trigger on close.
  • Escape and a click outside close it.

Tooltip

1 file
components/ui/tooltip.tsx

A short hint on hover or focus.

Hover or focus the button

When to use. A value or a name that does not fit, such as the exact number behind a bar. Wrap the area in TooltipProvider once.

Do

  • One short line.
  • A trigger that can take keyboard focus.

Don't

  • Information that exists only in the tooltip.
  • Links or buttons inside the tooltip.

Names, types and defaults read from components/ui/tooltip.tsx at build time.

Props of Tooltip
PropTypeDefaultWhat it does
TooltipProvider.delayDurationnumber200TooltipProvider: wait in ms before it opens.
TooltipContent.sideOffsetnumber6TooltipContent: gap from the trigger in px.
TooltipProvider...Radix Tooltip.Provider–Every Radix Tooltip prop. className only for layout: margin, width, grid placement.
TooltipContent...Radix Tooltip.Content–Every Radix Tooltip prop. className only for layout: margin, width, grid placement.

Accessibility

  • Shows on keyboard focus as well as hover, and stays open while focus scrolls the page to its trigger.
  • Inverse surface: inverseForeground on inverse, 15:1.

Typography

Components in components/typography. The badge counts the files that use each one.

Heading

7 files
components/typography/Heading.tsx

The one heading element. Level and look are separate props.

articleTitle, articleHeading, subheading, plain

Every state on one screen

Why the happy path is not enough

How it works

Pages they fetched

When to use. Every heading on the site goes through it. level follows the outline of the page, look follows the design. DisplayHeading and Subheading are shortcuts built on it.

Do

  • level from the outline: one 1 per page, no skipped level.
  • look from the place: articleTitle for a post title, articleHeading for a heading inside a post or a list.

Don't

  • A raw <h1> to <h6>: the guard rawHeading fails on it.
  • Choosing the level for its size: the look sets the size.

Names, types and defaults read from components/typography/Heading.tsx at build time.

Props of Heading
PropTypeDefaultWhat it does
level1 | 2 | 3 | 4requiredHeading level in the outline.
look"display" | "displaySm" | "sectionTitle" | "articleTitle" | "articleHeading" | "subheading" | "plain"requiredSize, weight and case from the type tokens.
capsboolean | nullfalseUppercase.
...<h2>–Every native <h2> attribute. className only for layout: margin, width, grid placement.

Accessibility

  • Renders a real h1 to h4, so the outline a screen reader lists is the one you wrote.

DisplayHeading

8 files
components/typography/DisplayHeading.tsx

The uppercase display heading: page titles and section titles. Built on Heading.

displaySm

Selected work

sectionTitle (default)

About

When to use. The h1 of a page and the h2 of a page section. It pulls itself left by the optical offset of its first letter.

Do

  • as="h1" exactly once per page.
  • text as a plain string, so the optical offset can read the first letter.

Don't

  • A raw <h1> or <h2> with a numeric text size.
  • Accent colour on a heading word.

Names, types and defaults read from components/typography/DisplayHeading.tsx at build time.

Props of DisplayHeading
PropTypeDefaultWhat it does
as"h1" | "h2""h2"Heading level.
size"display" | "displaySm" | "sectionTitle""sectionTitle"Fluid size from the type tokens.
textstringrequiredThe heading text.
srPrefixstring–Hidden words read before the text.
opticalAlignbooleantruePull the first letter onto the text edge.
...<h1>–Every native <h1> attribute. className only for layout: margin, width, grid placement.

Accessibility

  • srPrefix adds words a screen reader hears before the visible text.
  • Uppercase is CSS, so screen readers read the original case.

Subheading

6 files
components/typography/Subheading.tsx

A heading inside a section. Built on Heading.

Default and caps

How it works

How it works

When to use. The title of a block inside a section: a group of cards, a step, a sub-topic. Directly under the h1 it is the h2.

Do

  • as matches the outline: h2 under the h1, h3 under an h2.

Don't

  • Skipping a level: an h3 straight under the h1.

Names, types and defaults read from components/typography/Subheading.tsx at build time.

Props of Subheading
PropTypeDefaultWhat it does
as"h2" | "h3" | "h4""h3"Heading level, chosen by the outline, not by the look.
capsbooleanfalseUppercase, to sit next to display headings.
...<h3>–Every native h3 attribute, such as id. className only for layout: margin, width, grid placement.

Accessibility

  • Renders an h3 unless as says otherwise.

Eyebrow

2 files
components/typography/Eyebrow.tsx

A small uppercase label above a heading.

Above a heading

Case study

Grafbase

When to use. A category, a date or a kicker that names what follows.

Do

  • Short: one to three words.

Don't

  • A sentence.
  • Accent colour.

Names, types and defaults read from components/typography/Eyebrow.tsx at build time.

Props of Eyebrow
PropTypeDefaultWhat it does
...<span>–Every native span attribute. className only for layout: margin, width, grid placement.

Accessibility

  • mutedForeground on background, 5.6:1.

Contact

Components in components/contact. The badge counts the files that use each one.

GetInTouchButton

3 files
components/contact/GetInTouchButton.tsx

The one contact action: opens an email to Feri.

accent, outline sm, link inline

When to use. Wherever the page asks the reader to get in touch. The address is assembled at click time, so it never sits in the HTML.

Do

  • Keep the label Get in touch: one action, one label.

Don't

  • A second contact button with another label on the same page.
  • A mailto link.

Names, types and defaults read from components/contact/GetInTouchButton.tsx at build time.

Props of GetInTouchButton
PropTypeDefaultWhat it does
size"md" | "sm" | "inline""md"Button size.
variant"link" | "accent" | "outline""accent"accent as the main action, outline or link next to another one.
labelstring"Get in touch"Keep the default.
classNamestring–Layout only (margin, width, grid placement). Never colour, size or case.

Accessibility

  • The mail icon is aria-hidden; the label names the action.

PingMeButton

2 files
components/contact/PingMeButton.tsx

A button that opens a short contact form in place.

Closed; opens the form in place

It sends a real message.

What would you like to ask?

When to use. The closing call on a service page, where a question about the reader's product fits better than an email.

Do

  • A title that says what to write about.

Don't

  • Two on one page.
  • Inside a card or a popover: it grows the page downward.

Names, types and defaults read from components/contact/PingMeButton.tsx at build time.

Props of PingMeButton
PropTypeDefaultWhat it does
labelstring"Ping me"Button label.
titlestringrequiredThe question at the top of the form.
hintstring–A line under the button.
classNamestring–Layout only (margin, width, grid placement). Never colour, size or case.

Accessibility

  • The button carries aria-expanded and controls the panel.
  • The closed panel is inert, so nothing in it takes focus.

Layout

Components in components/layout. The badge counts the files that use each one.

PageShell

9 files
components/layout/PageShell.tsx

The frame of every page: skip link, header, main, footer.

This page is built in it.

When to use. The outermost element of every page. This page is built in it.

Do

  • nav={false} on pages that are not part of the site navigation.

Don't

  • A page that builds its own header or footer.

Names, types and defaults read from components/layout/PageShell.tsx at build time.

Props of PageShell
PropTypeDefaultWhat it does
childrenstring | number | bigint | boolean | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal | Promise<...> | nullrequiredThe page content.
navbooleantrueShow the site navigation.

Accessibility

  • Gives the page its main landmark with id main, the skip link target.

SiteHeader

1 file
components/layout/SiteHeader.tsx

The wordmark and the navigation. The top of this page.

The top of this page.

When to use. Only through PageShell.

Do

  • Let PageShell place it.

Don't

  • A second header inside a page.

Names, types and defaults read from components/layout/SiteHeader.tsx at build time.

Props of SiteHeader
PropTypeDefaultWhat it does
navbooleantrueShow the navigation.

Accessibility

  • Header landmark; navigation switches to a dialog below md.

MainNavigation

1 file
components/layout/MainNavigation.tsx

The desktop navigation with a sliding underline.

The top of this page, from 48rem up.

When to use. Inside SiteHeader from md up. Items come from navigationItems in lib/site.ts.

Do

  • Add a page by adding it to navigationItems.

Don't

  • Links typed into the component.

Names, types and defaults read from components/layout/MainNavigation.tsx at build time.

Props of MainNavigation
PropTypeDefaultWhat it does
classNamestring–Layout only (margin, width, grid placement). Never colour, size or case.

Accessibility

  • The underline follows the pointer and is decoration.
  • The current page carries aria-current="page", and a post under it marks its section with aria-current="true"; both get full-strength text.

MobileNavigation

1 file
components/layout/MobileNavigation.tsx

The phone navigation: a menu button that opens a full-screen dialog.

The top of this page below 48rem.

When to use. Inside SiteHeader below md.

Do

  • Same items as MainNavigation, from lib/site.ts.

Don't

  • A different set of links on phones.

Names, types and defaults read from components/layout/MobileNavigation.tsx at build time.

Props of MobileNavigation
PropTypeDefaultWhat it does
classNamestring–Layout only (margin, width, grid placement). Never colour, size or case.

Accessibility

  • Radix dialog: focus is trapped while open and returns to the menu button.
  • The current page carries aria-current="page", a post under it aria-current="true"; both are underlined.

SiteWordmark

2 files
components/layout/SiteWordmark.tsx

The name as a link to the home page.

When to use. In the header and the mobile menu.

Do

  • Use it wherever the name links home.

Don't

  • The name typed as text with its own styles.

Names, types and defaults read from components/layout/SiteWordmark.tsx at build time.

Props of SiteWordmark
PropTypeDefaultWhat it does
onClick(() => void)–Closes the mobile menu.

Accessibility

  • Target height 2.75rem.

Container

16 files
components/layout/Container.tsx

Centres content at one of the container widths, with the page gutter.

article, content, page

article
content
page

When to use. Every horizontal band of content. page for full layouts, content for wide text and media, article for reading.

Do

  • width from the three named sizes.

Don't

  • max-w and mx-auto written by hand.

Names, types and defaults read from components/layout/Container.tsx at build time.

Props of Container
PropTypeDefaultWhat it does
width"article" | "content" | "page" | null"page"76rem, 56rem or 42rem.
...<div>–Every native div attribute. className only for layout: margin, width, grid placement.

Accessibility

  • No semantics of its own: a div.

PageSection

3 files
components/layout/PageSection.tsx

A full-width home page section with its display title.

When to use. The bands of the home page: Work, About, Blog.

Do

  • tone="sunken" to separate it from the band above.

Don't

  • Nesting one inside another.

Names, types and defaults read from components/layout/PageSection.tsx at build time.

Props of PageSection
PropTypeDefaultWhat it does
idstringrequiredAnchor and heading id.
titlestringrequiredSection title (DisplayHeading h2).
tone"default" | "sunken""default"Background.
...<section>–Every native <section> attribute. className only for layout: margin, width, grid placement.

Accessibility

  • section labelled by its own heading.

SectionIntro

1 file
components/layout/SectionIntro.tsx

The title of a PageSection with its gap below.

When to use. Inside PageSection; rarely on its own.

Do

  • Pass the heading id the section is labelled by.

Don't

  • Adding a margin under it: the gap is the sectionTitleGap token.

Names, types and defaults read from components/layout/SectionIntro.tsx at build time.

Props of SectionIntro
PropTypeDefaultWhat it does
headingIdstringrequiredid of the heading.
titlestringrequiredHeading text.

Accessibility

  • Renders a DisplayHeading h2.

Content

Components in components/listing and components/media. The badge counts the files that use each one.

ListingCard

1 file
components/listing/ListingCard.tsx

A card in a list of posts, with the whole card clickable.

A post in the list

When to use. The blog index. It renders an <li>, so it goes inside a <ul>.

Do

  • meta for the date or category above the title.

Don't

  • A second link inside the card: the title link covers the card.

Names, types and defaults read from components/listing/ListingCard.tsx at build time.

Props of ListingCard
PropTypeDefaultWhat it does
hrefstringrequiredWhere the card goes.
titlestringrequiredCard title.
metastring | number | bigint | boolean | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal | Promise<...> | null–Above the title.
childrenstring | number | bigint | boolean | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal | Promise<...> | nullrequiredThe summary line.

Accessibility

  • The title is an h2 holding the only link; its after element stretches over the card.
  • Hover changes the background to secondaryHover.

AutoPlayVideo

4 files
components/media/AutoPlayVideo.tsx

A muted looping video that plays only while it is on screen.

When to use. Short product recordings and demos in case studies and blog posts.

Do

  • ariaLabel that says what the video shows.
  • A poster image.

Don't

  • Sound.
  • Autoplay when the visitor asks for reduced motion: it stays paused.

Names, types and defaults read from components/media/AutoPlayVideo.tsx at build time.

Props of AutoPlayVideo
PropTypeDefaultWhat it does
srcstringrequiredVideo file.
classNamestring–Layout only (margin, width, grid placement). Never colour, size or case.
ariaLabelstring–What the video shows.
posterstring–Still frame before loading.

Accessibility

  • Native controls, so it can be paused.
  • Respects prefers-reduced-motion, also when it changes while the page is open.

Article

Components in components/article. The badge counts the files that use each one.

ArticleLayout

6 files
components/article/ArticleLayout.tsx

The frame of a blog post: date, title, subtitle, body, author note.

When to use. Every post in app/blog. The post itself only passes its text and figures.

Do

  • Title, date and slug passed as props, the same as the post's entry in lib/blog-posts.ts, which feeds the blog list.
  • Body elements from ArticleElements.

Don't

  • A post that builds its own header.
  • Spacing between body paragraphs by hand: the layout sets it.

Names, types and defaults read from components/article/ArticleLayout.tsx at build time.

Props of ArticleLayout
PropTypeDefaultWhat it does
slugstringrequiredPost slug, for the structured data.
datestringrequiredISO date.
dateFormattedstringrequiredThe date as shown.
titlestringrequiredThe h1.
subtitlestring | number | bigint | boolean | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal | Promise<...> | nullrequiredThe lead under the title.
childrenstring | number | bigint | boolean | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal | Promise<...> | nullrequiredThe body.

Accessibility

  • The title is the only h1, through Heading look articleTitle.
  • The date is a <time> with a machine-readable dateTime.

ArticleElements

12 files
components/article/ArticleElements.tsx

The building blocks of a post body: ArticleHeading, ArticleSubheading, ArticleNote, ArticleList, ArticleOrderedList, ArticleFigure, InlineCode, CodeBlock, CodeKey, CodeValue, CodeMuted, TextLink.

Text, links and code

A sentence with a link inside the site, one to another site (opens in a new tab) and a token name like bg-surface.

<Heading level={2} look="articleHeading">

An ArticleNote: a small aside under a figure or a paragraph.

When to use. Inside ArticleLayout. Each one carries the spacing and type of a post, so the post file holds only content.

Do

  • ArticleHeading for an h2, ArticleSubheading for an h3.
  • TextLink with external for a link that leaves the site.
  • CodeKey, CodeValue and CodeMuted inside a CodeBlock to colour code.

Don't

  • A raw <a> or <code> in a post.
  • Raw hex inside a code sample: use CodeKey and CodeValue.

Names, types and defaults read from components/article/ArticleElements.tsx at build time.

Props of ArticleElements
PropTypeDefaultWhat it does
TextLink.externalbooleanfalseTextLink: open in a new tab, announced.
TextLink.showExternalIconbooleanfalseTextLink: the small arrow icon.
TextLink...<a>–Every native attribute of the element each one renders. className only for layout: margin, width, grid placement.

Accessibility

  • CodeBlock is a focusable region, so a keyboard can scroll a wide sample.
  • TextLink with external adds 'opens in a new tab' for screen readers.

ArticleFaq

1 file
components/article/ArticleFaq.tsx

The FAQ at the end of a post.

When to use. Posts that answer the questions people search for. The entries also feed the FAQ structured data.

Do

  • Questions in the reader's words.

Don't

  • An accordion: every answer stays visible and readable by search.

Names, types and defaults read from components/article/ArticleFaq.tsx at build time.

Props of ArticleFaq
PropTypeDefaultWhat it does
entriesFaqEntry[]requiredQuestion and answer pairs from lib/blog-posts.ts.

Accessibility

  • An h2 for the section and an h3 per question.

AuthorNote

2 files
components/article/AuthorNote.tsx

Who wrote it: a one-line byline, or a card with a note and a contact action.

Byline (no note)

Written byPortrait of Feri HorvathFeri

Card with a note

When to use. At the end of a post or a service page. Without note it is the short byline.

Do

  • contactLabel and contactTitle together, to open PingMeButton instead of the email button.

Don't

  • A second contact action next to it.

Names, types and defaults read from components/article/AuthorNote.tsx at build time.

Props of AuthorNote
PropTypeDefaultWhat it does
notestring–The card text. Without it, the byline.
contactLabelstring–Turns the action into PingMeButton.
contactTitlestring–The question in the PingMeButton form.
classNamestring–Layout only (margin, width, grid placement). Never colour, size or case.

Accessibility

  • The card is an aside labelled About the author.
  • The portrait has a real alt text.

ComparisonTable

2 files
components/article/ComparisonTable.tsx

A two-column comparison inside a post, wider than the text on large screens.

When to use. Comparing two approaches row by row.

Do

  • A caption that says what is compared; it is read, not shown.

Don't

  • More than two columns: it is built for this versus that.

Names, types and defaults read from components/article/ComparisonTable.tsx at build time.

Props of ComparisonTable
PropTypeDefaultWhat it does
captionstringrequiredScreen reader caption.
columns[string, string]requiredThe two column titles.
rows[string, string, string][]requiredRow label, then one cell per column.

Accessibility

  • Row headers are th scope=row.
  • Scrolls sideways on phones instead of squeezing.

Case study

Components in components/work. The badge counts the files that use each one.

CaseStudyGrid

2 files
components/work/CaseStudyGrid.tsx

The three case study cards on the home page, lined up on a shared grid.

When to use. The Work section of the home page.

Do

  • Pass the studies from lib/case-studies.ts.

Don't

  • Cards placed one by one outside the grid: the subgrid keeps their rows aligned.

Names, types and defaults read from components/work/CaseStudyGrid.tsx at build time.

Props of CaseStudyGrid
PropTypeDefaultWhat it does
studiesCaseStudy[]requiredThe studies to show.

Accessibility

  • A list, so a screen reader announces how many studies there are.

CaseStudyCard

1 file
components/work/CaseStudyCard.tsx

One case study: image, title, teaser, the whole card clickable.

Rest and hover

  • Grafbase dashboard with request, error and latency charts.

    Bringing GitHub PR-style review into the GraphQL federation workflow.

  • Grafbase dashboard with request, error and latency charts.

    Bringing GitHub PR-style review into the GraphQL federation workflow.

When to use. Inside CaseStudyGrid.

Do

  • A card image with an alt text in the study data.

Don't

  • A second link inside the card.

Names, types and defaults read from components/work/CaseStudyCard.tsx at build time.

Props of CaseStudyCard
PropTypeDefaultWhat it does
studyCaseStudyrequiredThe study.
classNamestring–Layout only (margin, width, grid placement). Never colour, size or case.

Accessibility

  • The title link stretches over the card; focus shows a ring around the whole card.
  • The image zoom on hover is off under reduced motion.

CaseStudySection

2 files
components/work/CaseStudySection.tsx

A labelled section of a case study page, and Paragraphs for its text.

When to use. Every part of a case study: Overview, Constraints, Process and so on.

Do

  • width article for reading, content (the default) or page for figures.

Don't

  • Splitting text into <p> by hand: Paragraphs does it from blank lines.

Names, types and defaults read from components/work/CaseStudySection.tsx at build time.

Props of CaseStudySection
PropTypeDefaultWhat it does
labelstringrequiredThe section name.
width"article" | "content" | "page""content"Reading width.
...<section>–Every native <section> attribute. className only for layout: margin, width, grid placement.

Accessibility

  • The label is the section's h2, rendered as an Eyebrow.

CaseStudyFacts

1 file
components/work/CaseStudyFacts.tsx

Role, team, skills and tools of a case study.

Grafbase

Team
Founder, Software Engineers, and me
Skills
Product Design · Systems Thinking · Prototyping
Tools
  • Figma logoFigma
  • After Effects logoAfter Effects

When to use. Near the top of a case study page.

Do

  • Fill the facts in lib/case-studies.ts; empty ones are left out.

Don't

  • Facts typed into the page.

Names, types and defaults read from components/work/CaseStudyFacts.tsx at build time.

Props of CaseStudyFacts
PropTypeDefaultWhat it does
studyCaseStudyrequiredThe study.

Accessibility

  • A description list: each fact has its label.

CaseStudyScreens

1 file
components/work/CaseStudyScreens.tsx

The large product screens placed after a given section of a case study.

When to use. Between case study sections, where the study data says.

Do

  • A caption that says what the screen shows.

Don't

  • A screen without alt text.

Names, types and defaults read from components/work/CaseStudyScreens.tsx at build time.

Props of CaseStudyScreens
PropTypeDefaultWhat it does
studyCaseStudyrequiredThe study.
placement"overview" | "context" | "approach" | "iteration" | "outcome"requiredThe section the screens follow.

Accessibility

  • Each screen is a figure with its caption.

ConstraintsList

1 file
components/work/ConstraintsList.tsx

What we knew and what we didn't, side by side.

Two groups

What we knew

  • Developers start from the terminal.
  • The schema is the product.

What we didn't know

  • How much of the setup people skip.
  • Which errors stop them first.

When to use. The Constraints part of a case study.

Do

  • Short lines, one fact each.

Don't

  • More than two groups.

Names, types and defaults read from components/work/ConstraintsList.tsx at build time.

Props of ConstraintsList
PropTypeDefaultWhat it does
knewstring[]requiredWhat was known.
didntKnowstring[]requiredWhat was not.

Accessibility

  • Each group has its own heading and list.