Components

Button

Triggers an action or navigates. Hierarchy, variant and size are properties; states are driven by the user and the platform.

Overview

When to use

  • To start an action (send, download, open Studio) or to move to another page.
  • As the primary call to action of a region, with at most one primary per region.

When not to use

  • For inline text links within a sentence: use a link.
  • To switch between views or options: use a segmented control.

Used on the portfolio: Hero actions · Studio section actions · Footer actions · Header: Customize this website · System Anatomy mock.

Preview and properties

The preview is the real Button, rendered from the same model the site uses. Properties are labelled by scope.

System property

The system default is "…" (change it in System Studio). An instance can override it.

Variantsystem

Component properties

Shapecomponent
Hierarchycomponent
Sizecomponent

Simulated state

Paints a state on this preview only. The live website is not affected.

Astro
<Button iconTrailing="arrow-right">Download CV</Button>
Rendered HTML
<button class="btn" data-component="button" data-hierarchy="primary" data-size="md" type="button">
  <span class="btn__label" data-part="label">Download CV</span>
  <svg class="icon" data-part="icon-trailing" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false">
    <path d="M5 12h14"/>
    <path d="m12 5 7 7-7 7"/>
  </svg>
</button>

System

Set in System Studio and applied to every button (the variant default). Changes the live site.

Component

Props of one instance: hierarchy, size, icons, label. They exist in code and affect only that button.

Preview only

Simulated states (hover, active, focus, disabled, loading). Painted on this page's preview; never applied to the live website.

Variant matrix

Every valid variant × hierarchy combination, rendered with the real component. Each variant is applied per instance (data-variant) so all appear at once.

Variant
Primary
Secondary
solid
outline
ghost
underline
offset

Five treatments: solid (filled accent), outline, ghost (text with a hover fill), underline (an underlined label, no box) andoffset (a thick border with a hard shadow in the text colour, elevation.offset). Treatment, hierarchy, size, shape, icon position and interaction state are independent properties: a treatment only sets colours, borders, shadow and decoration tokens; it never fixes a shape or a size.

Shape

The system corner style (Studio: sharp, subtle, soft, rounded, pill) sets button.radius for every button. An instance can override it with shape (pill or square), independent of the treatment.

Sizes

States

States are driven by the user and the platform. The matrix paints them with data-sim for documentation; real hover, active and focus use the same styles.

Variant
default
hover
active
focus
disabled
loading
solid
outline
ghost
underline
offset

Disabled and loading are mutually exclusive: a loading button stays focusable and announces that it is busy; a disabled button leaves the tab order. The component normalises an invalid combination and the playground explains why.

Anatomy

  1. 1Container. The interactive element: button, or a when it navigates.
  2. 2Leading icon. Optional, decorative (aria-hidden).
  3. 3Label. Short, starts with a verb. Always present unless icon-only.
  4. 4Trailing icon. Optional: direction (arrow) or external destination.
  5. ·Focus ring. A 2px outline offset 3px, using color.focus.ring.

Tokens

Button reads only component tokens. Variants replace the colour tokens; sizes replace the size tokens. Open any of them in the token explorer to follow its chain.

Component tokenReferencesResolved (dark)Resolved (light)
{color.accent.fill}#B9A6FF#B9A6FF
{color.accent.on-fill}#0C0C0C#0C0C0C
{color.accent.fill}#B9A6FF#B9A6FF
{color.text.primary}#EAE9E7#0C0C0C
{color.text.inverse}#0C0C0C#EAE9E7
{color.text.primary}#EAE9E7#0C0C0C
{color.text.inverse}#0C0C0C#EAE9E7
{color.text.primary}#EAE9E7#0C0C0C
{color.accent.fill}#B9A6FF#B9A6FF
{color.accent.on-fill}#0C0C0C#0C0C0C
{radius.control}2px2px
2rem2rem2rem
{space.inline.md}calc(16px * 1)calc(16px * 1)
{space.inline.xs}calc(8px * 1)calc(8px * 1)
{prim.font.size.xs}0.75rem0.75rem
2.75rem2.75rem2.75rem
{space.inline.lg}calc(24px * 1)calc(24px * 1)
{space.inline.sm}calc(12px * 1)calc(12px * 1)
{prim.font.size.xs}0.75rem0.75rem
3.5rem3.5rem3.5rem
{space.stack.md}calc(24px * 1)calc(24px * 1)
{space.inline.md}calc(16px * 1)calc(16px * 1)
{prim.font.size.sm}0.875rem0.875rem
{space.inline.sm}calc(12px * 1)calc(12px * 1)
{opacity.disabled}0.40.4
{border.width.hairline}1px1px
nonenonenone
nonenonenone
2px2px2px
{color.annotation}#B9A6FF#0C0C0C

Guidelines

Do

  • Use one primary button per region; make supporting actions secondary.
  • Write the label as a verb: "Download CV", "Open System Studio".
  • Choose the visual variant system-wide (Studio) and override it per instance only for a reason.

Do not

  • Disable a button to hide a feature; explain why it is unavailable instead.
  • Ship an icon-only button without an accessible name.
  • Stack more than two buttons in a row; use a list of links.

Limitation: there is no destructive or danger hierarchy yet, because the portfolio has no destructive actions. It is proposed, not implemented.

Accessibility

TopicBehaviour
KeyboardReachable with Tab. Space and Enter activate a button; Enter activates a link. Disabled buttons are removed from the tab order.
FocusA visible focus ring appears on keyboard focus. Its colour is a theme role (accent in dark, ink in light) validated at 3:1 or more against the page.
SemanticsNative button or a. Icons are aria-hidden. Links that open a new tab add visually hidden text.
Loadingaria-busy="true" and aria-disabled="true", with hidden "Loading" text. The spinner stops in reduced motion.
ContrastText on the accent fill measures 9.3:1 (dark) and 9.3:1 (light) for the default accent; the build checks every accent.
Target sizeMedium is 44px, small is 32px, both above the WCAG 2.2 minimum of 24px.

Code and API

PropertyTypeDefaultScopeDescription
hierarchy'primary' | 'secondary''primary'componentHow prominent the action is.
variant'inherit' | 'solid' | 'outline' | 'ghost' | 'underline' | 'offset''inherit'systemDefaults to the system choice; an instance may override it.
shape'inherit' | 'pill' | 'square''inherit'componentCorner shape for one instance; independent of the treatment.
size'sm' | 'md' | 'lg''md'componentHeight, padding, type size.
iconLeading / iconTrailingIconName—componentDecorative icon beside the label.
iconOnly + ariaLabelIconName + string—componentIcon-only button; ariaLabel is required.
href / externalstring / boolean—componentRenders an anchor; external opens a new tab safely.
disabled / loadingbooleanfalsecomponentMutually exclusive; links cannot be disabled.
sim'hover' | 'active' | 'focus'—preview onlyDocumentation only. Never used on the site.
Astro
import Button from '../components/ui/Button.astro';

<Button href="#work" iconTrailing="arrow-right">View selected work</Button>
<Button hierarchy="secondary" variant="outline" size="sm">Get in touch</Button>
<Button iconOnly="plus" ariaLabel="Add item" />
Per-instance override and tokens (CSS)
/* generated from variants.tokens.json */
.btn[data-variant="outline"] {
  --ds-button-primary-bg: transparent;
  --ds-button-primary-fg: var(--ds-color-text-primary);
  --ds-button-primary-border: var(--ds-color-text-primary);
}

Live example on this page: Follow button.primary.bg in the explorer

Beyond Design System v0.4.0Human-led. AI-assisted. System-driven.