stnd.build

Components

Components & Buttons

Components

Interactive buttons, button groups, loaders, and keycaps. Buttons extend %surface and %padding-text, providing tactile hover states, focus outlines, and active feedback.

Name Description
button Zero-class interactive button element. It is the primary action: no class is needed to say so, there is no .primary.
a.btn Anchor styled identically to a button.
.accent Variant (button.accent, a.btn.accent, .badge.accent) tinted with the accent color. Formerly .secondary.
.outline Outlined button with hairline border.
.destructive Destructive action button using error red.
.ghost Ghost button transparent until hover.
.icon Square icon action button.
.btn-group Segmented inline button group with shared borders.
.loader Rotating circular spinner with accent glow.
.link Button that reads as an inline link, tinted with --color-link.
.large, .small, .smaller Size steps for button and a.btn.
.disabled, :disabled Dimmed and inert, for button and a.btn.
.tag Muted label that turns accent on hover.
.badge Compact pill label. Variants: .accent, .outline, .ghost, .destructive; works on a too.

The button vocabulary: the default is the primary action

<div class="flex flex-wrap no-rhythm" style="gap: var(--space-d2); align-items: center">
  <button>Save</button>
  <button class="accent">Accent</button>
  <button class="outline">Outline</button>
  <button class="ghost">Ghost</button>
  <button class="link">Link</button>
  <button class="destructive">Delete</button>
</div>

Live

Sizes, icon and disabled

<div class="flex flex-wrap no-rhythm" style="gap: var(--space-d2); align-items: center">
  <button class="large">Large</button>
  <button>Default</button>
  <button class="small">Small</button>
  <button class="smaller">Smaller</button>
  <button disabled>Disabled</button>
  <button class="icon" aria-label="Add">+</button>
</div>

Live

An anchor styled as a button

<div class="flex flex-wrap no-rhythm" style="gap: var(--space-d2); align-items: center">
  <a class="btn" href="#">Primary link</a>
  <a class="btn accent" href="#">Accent link</a>
  <a class="btn outline" href="#">Outline link</a>
</div>

Live

A segmented group: the pressed one is read from aria-pressed

<div class="btn-group" role="group" aria-label="View">
  <button aria-pressed="true">Day</button>
  <button aria-pressed="false">Week</button>
  <button aria-pressed="false">Month</button>
</div>

Live

Loader

<span class="loader" role="status" aria-label="Loading"></span>

Live

Tags and badges

<div class="flex flex-wrap no-rhythm" style="gap: var(--space-d2); align-items: center">
  <a class="tag" href="#">#garden</a>
  <span class="badge">Default</span>
  <span class="badge accent">Accent</span>
  <span class="badge outline">Outline</span>
  <span class="badge ghost">Ghost</span>
  <span class="badge destructive">Destructive</span>
  <a class="badge" href="#">A link badge</a>
</div>

Live

#garden Default Accent Outline Ghost Destructive A link badge

Dot

components-feedback

A small round marker: a status beside a label, a legend key, an unread flag. It sits on the baseline of the text and rises by half the x-height (less half its own size), so it is centred on the lowercase letters as a typographer sets a bullet. That is what keeps it level with the text whatever the font is, and whether or not text-box-trim shrinks the line box, which centring on the box does not. In a flex row, set align-items: baseline on the row so the dot and the text share a baseline; a dot alone in a row that centres its items needs nothing, since at its default size it is as tall as the x-height.

Name Description
.dot The marker, in --color-muted until it is given a status.
.dot.success, .dot.warning, .dot.error, .dot.info, .dot.accent The status colour (see Colour roles); the dot is a status, so it follows the status roles, not a hue.
.dot.pulse A halo that grows and fades in the dot’s own colour, for something that needs attention. It stands still for anyone who asked for less motion.
--dot-size Hook: the diameter of the dots under it (default --space-d3).

A dot at the start of a label

<p><span class="dot success"></span> Available</p>
<p><span class="dot warning"></span> Almost full</p>
<p><span class="dot error"></span> Out of service</p>
<p><span class="dot info"></span> In transit</p>
<p><span class="dot"></span> Unknown</p>

Live

Available

Almost full

Out of service

In transit

Unknown

A dot that asks for attention

<p><span class="dot error pulse"></span> Battery under 20 %</p>

Live

Battery under 20 %

In a row of its own: the row aligns on the baseline

<div class="flex" style="align-items: baseline; gap: var(--space-d3); justify-content: space-between">
  <span><span class="dot error"></span> Full (no free dock)</span>
  <strong>3</strong>
</div>

Live

Full (no free dock) 3

Skeleton

components-feedback

A grey placeholder that holds the place of content still loading, so the page does not jump when it arrives. It shimmers, unless the reader asks for less motion. Mark the loading region aria-busy="true"; the placeholders themselves are decoration.

Name Description
.skeleton A placeholder block. Give it the size of what it stands for (width, height); by default it is one line of text.
.skeleton.circle A round placeholder (an avatar).
--skeleton-height Hook: the height of a default block (default 1em).
<div aria-busy="true">
  <div class="skeleton" style="width: 40%"></div>
  <div class="skeleton"></div>
</div>

Live

Color Swatches

components-forms

Compact interactive color swatch pills and chips for palettes, themes, and pickers.

Name Description
.swatch Compact color chip button or preview container.
.swatch.circle, .swatch.round Circular variant.
.swatch.small Micro swatch sized at mathematical unit --space.
.swatch.large Macro swatch sized at mathematical unit --space-3.

Sizes and shapes

<div class="flex flex-wrap no-rhythm" style="gap: var(--space-d2); align-items: center">
  <button class="swatch small" style="background: var(--color-red)" aria-label="Red"></button>
  <button class="swatch" style="background: var(--color-green)" aria-label="Green"></button>
  <button class="swatch large" style="background: var(--color-blue)" aria-label="Blue"></button>
  <button class="swatch circle" style="background: var(--color-orange)" aria-label="Orange"></button>
  <button class="swatch circle large" style="background: var(--color-purple)" aria-label="Purple"></button>
</div>

Live

Alert Banners

components-feedback

Contextual feedback notifications with status colors and left accent borders.

Name Description
.alert Container banner using interface typography and status tinting.
.alert.success Success alert themed with green status color.
.alert.warning Warning alert themed with orange status color.
.alert.error Error alert themed with red status color.
.alert.info Informational alert themed with blue status color.

The four statuses, and the neutral one

<div class="alert">A neutral note, in the accent.</div>
<div class="alert success">Saved. Your changes are live.</div>
<div class="alert info">Indexing 1 204 photos in the background.</div>
<div class="alert warning">The volume is almost full.</div>
<div class="alert error">Could not reach the server.</div>

Live

A neutral note, in the accent.
Saved. Your changes are live.
Indexing 1 204 photos in the background.
The volume is almost full.
Could not reach the server.

An action inside an alert inherits its colour

<div class="alert warning">
  Your plan ends in 3 days.
  <a class="alert-action" href="#">Renew</a>
</div>

Live

Your plan ends in 3 days. Renew

Card Component

components-layout

In 1991, Edward Tufte published “Envisioning Information” and introduced the concept of “small multiples”—the idea that human brains excel at comparing information when it’s presented in identical visual containers. Show someone seven weather forecasts in seven different layouts, and they’ll struggle. Show them seven identical cards with different data, and patterns emerge instantly. The structure disappears, the content shines.

But here’s the catch: small multiples only work when they’re truly identical. One card with 16px padding, another with 20px, a third with 18px—your brain registers the inconsistency before it processes the content. This component solves that problem by providing a single source of truth for card structure. Every card gets the same padding, the same borders, the same rhythm. Build one card or build a hundred—they’ll feel like family.

The Swiss designers understood this in the 1950s. Josef Müller-Brockmann’s concert posters used rigid grids not to constrain creativity, but to amplify it. When the structure is invisible, when it just works, your content can breathe. That’s what .card does—it handles the boring consistency so you can focus on making something beautiful.

Future Improvements

A card is read by its elements, not by extra classes: an article.card holds a header (the title, optionally followed by an icon outside the heading), a plain div (the body, with automatic vertical rhythm) and a footer (the actions, aligned with .flex-right or .flex-left). Each part is optional.

Name Description
.card Structured container with surface elevation, hairline borders, and rhythm padding.
.card > header Title area; holds the heading and, outside it, an optional icon set in cap units (it goes to the far end, on the title’s baseline).
.card > div Main content body with automatic vertical rhythm.
.card > footer Bottom action bar for links and buttons; add .flex-right or .flex-left to align them.
.card.clickable Interactive clickable card variant with hover lift.
.card-grid Responsive grid container specifically designed for card multiples.
.inset Inset variant: the shadow is drawn inside, so the card looks pressed in.
.card > header.surface Header variant that sits on a raised surface with a bottom border.

Basic card structure

  <article class="card">
    <header>
      <h3>Card Title</h3>
    </header>
    <div>
      <p>Card content with automatic spacing and rhythm.</p>
    </div>
    <footer class="flex-right">
      <a href="#" class="btn ghost">Read more →</a>
      <a href="#" class="btn">Continue</a>
    </footer>
  </article>

Live

Cards in grid layout (3-column responsive)

  <div class="grid sm:grid-1">
    <article class="card">
      <header>
        <h3>Feature One</h3>
      </header>
      <p>Description...</p>
    </article>
    <article class="card">...</article>
    <article class="card">...</article>
  </div>

Live

Feature One

Description…

…
…

Icon in the title (sized to the heading’s cap height, on its baseline)

  <article class="card">
    <header>
      <h3>Connect</h3>
      <svg width="1cap" height="1cap">…</svg>
    </header>
    <div>
      <p>Why this matters.</p>
    </div>
  </article>

Live

Connect

…

Why this matters.

Clickable card (entire card is a link)

  <a href="/article" class="card clickable">
    <header>
      <h3>Article Title</h3>
    </header>
    <div>
      <p>Preview text that entices you to click...</p>
    </div>
  </a>

Live

Customizing card via CSS variables

  .card.custom {
    --card-border-color: var(--color-accent);
    --card-padding: var(--scale-2);
    --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  }

An inset card: pressed into the page instead of raised

<article class="card inset">
  <header><h3>Inset</h3></header>
  <div>The shadow is drawn inside, so the card reads as a well.</div>
</article>

Live

Inset

The shadow is drawn inside, so the card reads as a well.

author Francis Fontaine · since 0.11.0 · see {class} .grid – Often used to layout multiple cards in columns · see {variable} —base – Controls internal spacing rhythm · see {class} .prose – Can be used inside the card body for rich content · see {class} .flex-right – Aligns the actions of a card footer · link https://en.wikipedia.org/wiki/Edward_Tufte Information Design Pioneer · link https://www.nngroup.com/articles/cards-component/ NN/g Cards Research

Clickable Card Variant

components-layout

Sometimes your entire card should be clickable—a blog post preview, a product listing, a project showcase. This variant ensures proper hover states, focus indicators, and cursor feedback while maintaining the card’s structural integrity.

The subtle lift on hover (2px translateY) and enhanced shadow create the illusion of depth—like the card is rising toward you. It’s a tactile metaphor for “this is interactive.” The focus-visible outline ensures keyboard users can see exactly where they are.

Accessibility note: When using clickable cards, ensure the link text is descriptive. “Read more” alone isn’t enough—screen readers need context. Use “Read more about [article title]” or aria-label.

Accessible clickable card

  <a href="/article/typography-history" class="card clickable"
     aria-label="Read full article about Typography History">
    <header>
      <h3>Typography History</h3>
    </header>
    <div>
      <p>The evolution of type from Gutenberg to now...</p>
    </div>
    <footer>
      Read more →
    </footer>
  </a>

Live

since 0.11.0 · see {class} .card – Base component · see {element} a – Applied to anchor tag wrapping card content

Comments

components

Threaded discussion list with author names, timestamps, and quotes.

Name Description
#comments Root comments container.
.comment Single comment card with surface background and elevation.
.comment-header Author, date, and status metadata bar.
.comment-content Indented comment message body.

A thread

<section id="comments">
  <div class="comment">
    <div class="comment-header"><span class="comment-author">Ada</span><span class="comment-date">2 hours ago</span></div>
    <div class="comment-content">The rhythm of this page reads beautifully.</div>
  </div>
  <div class="comment">
    <div class="comment-header"><span class="comment-author">Linus</span><span class="comment-pending">awaiting moderation</span></div>
    <div class="comment-content">Agreed. One question about the grid.</div>
  </div>
</section>

Live

Ada2 hours ago
The rhythm of this page reads beautifully.
Linusawaiting moderation
Agreed. One question about the grid.

since 0.11.0

components-feedback

Actions within alerts (links, buttons) should be visually distinct but not overwhelming. This provides subtle styling that inherits the alert’s color.

Name Description
.alert-action Inline action link within an alert, inheriting --_alert.

since 0.11.0

components

Shortcuts for keyboard users, hidden until they take focus: press Tab on a page and the first thing reached is a link to the main content. .skip-links stacks several of them in the top-left corner.

Name Description
a.skip-link A link that slides into view on focus (Tab) and jumps past the navigation.
.skip-links Container stacking several skip links in the corner.

Click into the box, then press Tab

<div class="skip-links" style="position: static">
  <a class="skip-link" href="#main">Skip to content</a>
  <a class="skip-link" href="#nav">Skip to navigation</a>
</div>

Live

Scroll Container

components

A box that scrolls on its own axis, for content wider than the page (a table, a long code line). Inside prose a .scroll that holds a table takes the wide track.

Name Description
.scroll Scrolling container, full width.
.scroll.show-left-shadow, .scroll.show-right-shadow Edge shadows hinting at hidden content; currently switched off in the stylesheet.

A wide table that scrolls inside its own box

<div class="scroll" style="max-width: 14rem">
  <table>
    <thead><tr><th>Quarter</th><th>North</th><th>South</th><th>East</th><th>West</th><th>Total</th></tr></thead>
    <tbody><tr><td>Q1</td><td>120</td><td>98</td><td>143</td><td>87</td><td>448</td></tr></tbody>
  </table>
</div>

Live

QuarterNorthSouthEastWestTotal
Q11209814387448

Field

components

A label stacked over its control, with the rhythm gap between them. The label takes the bold interface style.

Name Description
.field Vertical stack of a label and one form control.

A labelled control

<div class="field">
  <label for="ex-field">Display name</label>
  <input id="ex-field" type="text" placeholder="Ada">
</div>

Live

Tooltips

components

A CSS-only tooltip: put the text in data-tooltip and it appears above the element on hover or keyboard focus. No script, no markup. It is a hint, not a place for anything a touch user needs: a button that only has an icon still needs its own accessible name.

Name Description
data-tooltip? The tooltip text; shown above the element on hover or keyboard focus.
data-tooltip-pos="bottom"? Places the tooltip below the element instead.

Above (the default) and below

<div class="flex flex-wrap no-rhythm" style="gap: var(--space-2); padding-block: var(--space-2)">
  <button data-tooltip="Saves the draft">Save</button>
  <button class="outline" data-tooltip="Opens the preview" data-tooltip-pos="bottom">Preview</button>
</div>

Live

All classes

Buttons

Class Declares
.loader width: var(--scale-2)
.btn-group display: inline-flex
.tag:hover color: var(--color-accent)
.badge display: inline-flex
.badge.accent, a.badge.accent background-color: var(--color-surface-raised)
.badge.outline background-color: transparent
.badge.ghost background-color: transparent
.badge.destructive background-color: var(--color-surface-raised)
.dot --_dot-size: var(--dot-size, var(--space-d3))
.skeleton display: block
.swatch, :where(button, a.btn).swatch all: unset
.alert font-family: var(--font-interface)
.alert.error --_alert: var(--color-error)
.alert.success --_alert: var(--color-success)
.alert.info --_alert: var(--color-info)
.grid - Often used to layout multiple cards in columns * @see —
.prose - Can be used inside the card body for rich content * @see —
.flex-right - Aligns the actions of a card footer * * @link https://en.wikipedia.org/wiki/Edward_Tufte Information Design Pioneer * @link https://www.nngroup.com/articles/cards-component/ NN/g Cards Research * * @example html - Basic card structure * <article class="card"> * <header> * <h3>Card Title</h3> * </header> * <div> * <p>Card content with automatic spacing and rhythm.</p> * </div> * <footer class="flex-right"> * <a href="#" class="btn ghost">Read more →</a> * <a href="#" class="btn">Continue</a> * </footer> * </article> * * @example html - Cards in grid layout (3-column responsive) * <div class="grid sm:grid-1"> * <article class="card"> * <header> * <h3>Feature One</h3> * </header> * <p>Description...</p> * </article> * <article class="card">...</article> * <article class="card">...</article> * </div> * * @example html - Icon in the title (sized to the heading's cap height, on its baseline) * <article class="card"> * <header> * <h3>Connect</h3> * <svg width="1cap" height="1cap">…</svg> * </header> * <div> * <p>Why this matters.</p> * </div> * </article> * * @example html - Clickable card (entire card is a link) * <a href="/article" class="card clickable"> * <header> * <h3>Article Title</h3> * </header> * <div> * <p>Preview text that entices you to click...</p> * </div> * </a> * * @example scss - Customizing card via CSS variables * .card.custom —
.card - Base component * @see —
.card > header:first-child background: var(--color-surface-overlay)
.card > footer:last-child background: var(--color-background)
.card.clickable text-decoration: none
.inset, .card.inset box-shadow: var(--shadow-inset) !important
.alert-action display: inline-block
.skip-links position: absolute
.scroll position: relative
.field display: flex