Tab through the buttons to see focus, and press and hold one to see pressed. Turn on With icon to see the icon slot, and With copy for the copy pattern: press Copy prompt and the check and Copied take the glyph's and label's place without the button changing size (shown copied in the pressed state). Change Density and Radius in Design settings: height and corners follow; set Motion to still and the busy spinner stands still beside its words.
What we found at the footbridge, and what to do before winter.
The river
The river , and both times the footbridge held. The second rise came within a hand of the deck boards, which is closer than any year since the bridge was rebuilt.
We recommend raising the deck by one course before the spring melt. The cost is modest and the work can be done in two days with the water low.
The path
The path on the north bank is washed out for about twenty metres. Walkers are cutting across the meadow, which is doing more harm than the river did.
What we found at the footbridge, and what to do before winter.
The river
The river , and both times the footbridge held. The second rise came within a hand of the deck boards, which is closer than any year since the bridge was rebuilt.
We recommend raising the deck by one course before the spring melt. The cost is modest and the work can be done in two days with the water low.
The path
The path on the north bank is washed out for about twenty metres. Walkers are cutting across the meadow, which is doing more harm than the river did.
What we found at the footbridge, and what to do before winter.
The river
The river , and both times the footbridge held. The second rise came within a hand of the deck boards, which is closer than any year since the bridge was rebuilt.
The path
The path on the north bank is washed out for about twenty metres. Walkers are cutting across the meadow, which is doing more harm than the river did.
What we found at the footbridge, and what to do before winter.
The river
The river , and both times the footbridge held. The second rise came within a hand of the deck boards, which is closer than any year since the bridge was rebuilt.
We recommend raising the deck by one course before the spring melt. The cost is modest and the work can be done in two days with the water low.
The path
The path on the north bank is washed out for about twenty metres. Walkers are cutting across the meadow, which is doing more harm than the river did.
What we found at the footbridge, and what to do before winter.
The river
The river , and both times the footbridge held. The second rise came within a hand of the deck boards, which is closer than any year since the bridge was rebuilt.
We recommend raising the deck by one course before the spring melt. The cost is modest and the work can be done in two days with the water low.
The path
The path on the north bank is washed out for about twenty metres. Walkers are cutting across the meadow, which is doing more harm than the river did.
What we found at the footbridge, and what to do before winter.
The river
The river , and both times the footbridge held. The second rise came within a hand of the deck boards, which is closer than any year since the bridge was rebuilt.
We recommend raising the deck by one course before the spring melt. The cost is modest and the work can be done in two days with the water low.
The path
The path on the north bank is washed out for about twenty metres. Walkers are cutting across the meadow, which is doing more harm than the river did.
What we found at the footbridge, and what to do before winter.
The river
The river rose twice that week, and both times the footbridge held. The second rise came within a hand of the deck boards, which is closer than any year since the bridge was rebuilt.
We recommend raising the deck by one course before the spring melt. The cost is modest and the work can be done in two days with the water low.
The path
The path on the north bank is washed out for about twenty metres. Walkers are cutting across the meadow, which is doing more harm than the river did.
What we found at the footbridge, and what to do before winter.
The river
The river rose twice that week, and both times the footbridge held. The second rise came within a hand of the deck boards, which is closer than any year since the bridge was rebuilt.
We recommend raising the deck by one course before the spring melt. The cost is modest and the work can be done in two days with the water low.
The path
The path on the north bank is washed out for about twenty metres. Walkers are cutting across the meadow, which is doing more harm than the river did.
What we found at the footbridge, and what to do before winter.
The river
The river , and both times the footbridge held. The second rise came within a hand of the deck boards, which is closer than any year since the bridge was rebuilt.
We recommend raising the deck by one course before the spring melt. The cost is modest and the work can be done in two days with the water low.
The path
The path on the north bank is washed out for about twenty metres. Walkers are cutting across the meadow, which is doing more harm than the river did.
What we found at the footbridge, and what to do before winter.
The river
The river , and both times the footbridge held. The second rise came within a hand of the deck boards, which is closer than any year since the bridge was rebuilt.
We recommend raising the deck by one course before the spring melt. The cost is modest and the work can be done in two days with the water low.
The path
The path on the north bank is washed out for about twenty metres. Walkers are cutting across the meadow, which is doing more harm than the river did.
What we found at the footbridge, and what to do before winter.
The river
The river , and both times the footbridge held. The second rise came within a hand of the deck boards, which is closer than any year since the bridge was rebuilt.
We recommend raising the deck by one course before the spring melt. The cost is modest and the work can be done in two days with the water low.
The path
The path on the north bank is washed out for about twenty metres. Walkers are cutting across the meadow, which is doing more harm than the river did.
What we found at the footbridge, and what to do before winter.
The river
The river rose twice that week, and both times the footbridge held. The second rise came within a hand of the deck boards, which is closer than any year since the bridge was rebuilt.
We recommend raising the deck by one course before the spring melt. The cost is modest and the work can be done in two days with the water low.
The path
The path on the north bank is washed out for about twenty metres. Walkers are cutting across the meadow, which is doing more harm than the river did.
What we found at the footbridge, and what to do before winter.
The river
The river rose twice that week, and both times the footbridge held. The second rise came within a hand of the deck boards, which is closer than any year since the bridge was rebuilt.
ParagraphWe recommend raising the deck
We recommend raising the deck by one course before the spring melt. The cost is modest and the work can be done in two days with the water low.
The path
The path on the north bank is washed out for about twenty metres. Walkers are cutting across the meadow, which is doing more harm than the river did.
What we found at the footbridge, and what to do before winter.
The river
The river rose twice that week, and both times the footbridge held. The second rise came within a hand of the deck boards, which is closer than any year since the bridge was rebuilt.
ParagraphWe recommend raising the deck
We recommend raising the deck by one course before the spring melt. The cost is modest and the work can be done in two days with the water low.
The path
The path on the north bank is washed out for about twenty metres. Walkers are cutting across the meadow, which is doing more harm than the river did.
What we found at the footbridge, and what to do before winter.
The river
The river , and both times the footbridge held. The second rise came within a hand of the deck boards, which is closer than any year since the bridge was rebuilt.
We recommend raising the deck by one course before the spring melt. The cost is modest and the work can be done in two days with the water low.
The path
The path on the north bank is washed out for about twenty metres. Walkers are cutting across the meadow, which is doing more harm than the river did.
What we found at the footbridge, and what to do before winter.
The river
The river rose twice that week, and both times the footbridge held. The second rise came within a hand of the deck boards, which is closer than any year since the bridge was rebuilt.
ParagraphWe recommend raising the deck
We recommend raising the deck by one course before the spring melt. The cost is modest and the work can be done in two days with the water low.
The path
The path on the north bank is washed out for about twenty metres. Walkers are cutting across the meadow, which is doing more harm than the river did.
What we found at the footbridge, and what to do before winter.
The river
The river , and both times the footbridge held. The second rise came within a hand of the deck boards, which is closer than any year since the bridge was rebuilt.
We recommend raising the deck by one course before the spring melt. The cost is modest and the work can be done in two days with the water low.
The path
The path on the north bank is washed out for about twenty metres. Walkers are cutting across the meadow, which is doing more harm than the river did.
Build the Button component (cmp-button, Basic · Actions) for Pipeup in this codebase. Status: stable. A proposed component may still change; a stable one is locked.
What it is for: What can I do next here?
Use the codebase's existing UI stack. Reproduce the design exactly. Add no variants, states, props or tokens that are not listed here. If something seems to be missing, stop and ask.
## Variants
These are the only variants. Each one exists for the reason given.
- `primary` (class `ds-button--primary`) — the one obvious next action in a view: an ink fill with light text. At most one per view.
- `secondary` (class `ds-button--secondary`) — every other action beside a primary, or the main action when it is not the obvious next step: a raised surface with an outline.
- `quiet` (class `ds-button--quiet`) — a low-emphasis action that should not compete: cancel, skip, "do it anyway", actions in dense rows and headers. No fill or outline at rest.
- `link` (class `ds-button--link`) — words that read as a link, with no fill, outline or side padding, so they line up with the text around them: a back link above a page title ("‹ Home"), or a small link in a strip. Muted at rest; darker and underlined on hover.
- `danger` (class `ds-button--danger`) — an action that removes or overwrites something and cannot be undone silently: a solid danger fill. Its label names what is removed.
- `join-start` (class `ds-button--join-start`) — the first of two buttons joined as one control (a main action, then the chevron that opens its menu): its end corners are square. Combine it with a colour variant, for example `ds-button ds-button--secondary ds-button--join-start`.
- `join-end` (class `ds-button--join-end`) — the second of the pair, set right after a `join-start` button: its start corners are square, its border overlaps its partner's, and its padding is tight around one icon. When it holds only an icon, its label is a `ds-visually-hidden` span.
- `ringed` (class `ds-button--ringed`) — inside a ring that draws the control's edge (cmp-prompt-card `ring`): no outline of its own in any state. With `join-end` it keeps the thin divider between the two halves of a split button.
- `lg` (class `ds-button--lg`) — a larger size for the ways to start on a public page's opening screen (two numbered choices at most). Combine it with one of the variants above, for example `ds-button ds-button--primary ds-button--lg`.
## States
Make every state reachable and visually distinct. Add no others.
- `default`
- `hover`
- `focus`
- `pressed`
- `disabled`
- `busy`
## Toggles
Optional parts that can be switched on or off.
- `with-icon`: an optional part, shown only when switched on; in the canonical markup it is the element marked `data-toggle="with-icon"`.
- `with-copy`: an optional part, shown only when switched on; in the canonical markup it is the element marked `data-toggle="with-copy"`.
## Anatomy
- Root: `<button class="ds-button ds-button--<variant>" type="button">`, or `<a class="ds-button ds-button--<variant>">` when it navigates.
- Label: the text inside the root. Always present, even with an icon.
- Icon (optional): `<span class="ds-icon" data-icon="<name>"></span>` before the label (after it only for `chevron-right`, `chevron-down`, `arrow-right` or `external`). The button sizes it to the small icon size.
- Spinner (busy only): `<span class="ds-button__spinner" aria-hidden="true"></span>`, in the icon's place, with `aria-busy="true"` on the root and a label that says what is happening ("Saving").
- Copy (optional, with-copy): the one way a button copies text, wherever it sits (a prompt, a step, a dialog). The root carries `data-ds-copy`, so cmp-code-block's script copies the nearest code block and sets `data-copied` for a moment. Inside, in this order:
- `<span class="ds-icon ds-button__copy-icon" data-icon="copy"></span>` and `<span class="ds-icon ds-button__done-icon" data-icon="check"></span>`: the check replaces the copy glyph while the button has `data-copied`.
- `<span class="ds-button__label">` holding `<span data-ds-copy-label>Copy prompt</span>`, the words the script changes ("Copied", or "Press Ctrl+C" when the clipboard is blocked), over two `<span class="ds-button__sizer" aria-hidden="true">` spans holding "Press Ctrl+C" and the label itself, so the widest words set the width and the button never changes size.
## Canonical markup
The design system's own markup for this component. Match its structure and roles in your stack; the class names show which part is which.
```html
<!-- variant: primary -->
<button class="ds-button ds-button--primary" type="button"><span class="ds-icon" data-icon="check" data-toggle="with-icon"></span>Save changes</button>
<!-- variant: secondary -->
<button class="ds-button ds-button--secondary" type="button"><span class="ds-icon" data-icon="copy" data-toggle="with-icon"></span>Copy link</button>
<!-- variant: quiet -->
<button class="ds-button ds-button--quiet" type="button"><span class="ds-icon" data-icon="chevron-left" data-toggle="with-icon"></span>Back</button>
<!-- variant: link -->
<a class="ds-button ds-button--link"><span class="ds-icon" data-icon="chevron-left" data-toggle="with-icon"></span>All projects</a>
<!-- variant: danger -->
<button class="ds-button ds-button--danger" type="button"><span class="ds-icon" data-icon="alert" data-toggle="with-icon"></span>Delete item</button>
<!-- variant: join-start -->
<button class="ds-button ds-button--secondary ds-button--join-start" type="button"><span class="ds-icon" data-icon="copy" data-toggle="with-icon"></span>Copy prompt</button>
<!-- variant: join-end -->
<button class="ds-button ds-button--secondary ds-button--join-start" type="button"><span class="ds-icon" data-icon="copy" data-toggle="with-icon"></span>Copy prompt</button>
<!-- variant: ringed -->
<button class="ds-button ds-button--secondary ds-button--join-start ds-button--ringed" type="button"><span class="ds-icon" data-icon="copy" data-toggle="with-icon"></span>Copy prompt</button>
<!-- variant: lg -->
<a class="ds-button ds-button--primary ds-button--lg">Get started<span class="ds-icon" data-icon="chevron-right" data-toggle="with-icon"></span></a>
<!-- with with-copy -->
<button class="ds-button ds-button--secondary" type="button" data-ds-copy data-toggle="with-copy"><span class="ds-icon ds-button__copy-icon" data-icon="copy"></span><span class="ds-icon ds-button__done-icon" data-icon="check"></span><span class="ds-button__label"><span data-ds-copy-label>Copy prompt</span><span class="ds-button__sizer" aria-hidden="true">Press Ctrl+C</span><span class="ds-button__sizer" aria-hidden="true">Copy prompt</span></span></button>
```
## Used by composites
Keep this component's API and these variants stable; these composites depend on them.
- `cmp-comment-card` — Comment card uses variants link, primary, quiet
- `cmp-page-header` — Page header uses variants primary, secondary
- `cmp-popover-menu` — Popover menu uses variants join-end, join-start, link, quiet, secondary
- `cmp-prompt-card` — Prompt card uses variants join-start, ringed, secondary
- `cmp-site-header` — Site header uses variants link, quiet
## Tokens
Map each token to the theme variable of the same name in your codebase, with its value in every preset. Never hard-code a value.
- `--ds-border-width`: `1px`
- `--ds-border-width-strong`: `2px`
- `--ds-color-accent`: light `#534AB7` · dark `#9A92EE` · contrast `#3A3390`
- `--ds-color-accent-hover`: light `#463EA3` · dark `#ACA5F3` · contrast `#2E2873`
- `--ds-color-accent-pressed`: light `#3A3390` · dark `#8A82E0` · contrast `#231E59`
- `--ds-color-border-strong`: light `#2F3437` · dark `#ECEBE6` · contrast `#000000`
- `--ds-color-focus-ring`: light `#534AB7` · dark `#9A92EE` · contrast `#0038C7`
- `--ds-color-status-danger`: light `#8A2E22` · dark `#F0A08E` · contrast `#8A1600`
- `--ds-color-surface-raised`: light `#FFFFFF` · dark `#22221F` · contrast `#FFFFFF`
- `--ds-color-surface-sunken`: light `#F7F6F3` · dark `#161614` · contrast `#F2F2F2`
- `--ds-color-text-default`: light `#2F3437` · dark `#ECEBE6` · contrast `#000000`
- `--ds-color-text-muted`: light `#5F5E5A` · dark `#B4B2A9` · contrast `#2E2E33`
- `--ds-color-text-on-accent`: light `#FFFFFF` · dark `#1B1B19` · contrast `#FFFFFF`
- `--ds-control-height`: compact `30px` · regular `36px` · roomy `44px`
- `--ds-focus-offset`: `2px`
- `--ds-focus-width`: `2px`
- `--ds-font-family-base`: `"Geist", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Helvetica Neue", system-ui, sans-serif`
- `--ds-icon-size`: `18px` in every preset (outline, solid)
- `--ds-icon-size-sm`: `16px` in every preset (outline, solid)
- `--ds-motion-ease`: still `linear` · subtle `cubic-bezier(0.2, 0, 0, 1)` · lively `cubic-bezier(0.34, 1.5, 0.64, 1)` · reduced motion `linear`
- `--ds-motion-ease-steady`: `linear` in every preset (still, subtle, lively)
- `--ds-motion-quick`: still `0ms` · subtle `120ms` · lively `160ms` · reduced motion `0ms`
- `--ds-motion-settle`: still `0ms` · subtle `180ms` · lively `320ms` · reduced motion `0ms`
- `--ds-opacity-disabled`: `0.45`
- `--ds-radius-control`: square `1px` · soft `8px` · round `999px`
- `--ds-space-1`: compact `3px` · regular `4px` · roomy `5px`
- `--ds-space-2`: compact `6px` · regular `8px` · roomy `10px`
- `--ds-space-4`: compact `12px` · regular `16px` · roomy `20px`
- `--ds-space-5`: compact `16px` · regular `24px` · roomy `32px`
- `--ds-target-min`: compact `24px` · regular `32px` · roomy `44px`
- `--ds-text-leading-tight`: `1.25`
- `--ds-text-size-lg`: `19px`
- `--ds-text-size-md`: `16px`
- `--ds-text-tracking-normal`: `0em`
- `--ds-text-weight-medium`: `500`
## Must respond to the configuration
The component changes with every setting below, live, without a reload. Under reduced motion nothing moves.
- Theme (`data-ds-theme` on the design-system root): `light` (default), `dark`, `contrast`
- Icons (`data-ds-icons` on the design-system root): `outline` (default), `solid`
- Motion (`data-ds-motion` on the design-system root): `still`, `subtle` (default), `lively`
- Density (`data-ds-density` on the design-system root): `compact`, `regular` (default), `roomy`
- Radius (`data-ds-radius` on the design-system root): `square`, `soft` (default), `round`
## Accessibility
- Use a native `<button type="button">` (or `type="submit"` in a form) for actions and `<a href>` for navigation; never a `div` or `span` with a click handler.
- The accessible name is the visible label. An icon next to a label is decorative and is hidden from assistive technology by the icon renderer.
- Enter and Space activate a button; Enter activates a link. Focus shows the focus ring on every variant.
- Disabled: use the `disabled` attribute on a `<button>`, and `aria-disabled="true"` (with no `href`) on a link. Prefer keeping an action enabled and explaining what is missing when pressed.
- Busy: set `aria-busy="true"` and change the label to say what is happening; keep the button focusable so focus is not lost.
- Copy: the accessible name is the label; the sizers are hidden from assistive technology, and a polite live region says "Copied to the clipboard" (cmp-code-block's script).
- Text on every fill meets AA in every theme (`text-on-accent` on `accent`, `accent-hover`, `accent-pressed` and `status-danger`).
- Pattern: https://www.w3.org/WAI/ARIA/apg/patterns/button/
## Interaction
Follow every rule here; the shared rules (int-NN) apply to every component in this design system.
- Hover and press change colour over `--ds-motion-quick` on `--ds-motion-ease`, and nothing changes size or position (int-01, int-03).
- Focus is always visible, and pressing or finishing never moves focus elsewhere (int-02).
- Busy keeps the button's height and place: the spinner takes the icon's place and the label says what is happening (int-05).
- Copy keeps the button's width, height and place while its glyph cross-fades into a check and its label's new words ("Copied") fade in, over `--ds-motion-settle`, for a moment; going back, the check cross-fades back to the copy glyph and the label returns at once. Focus stays on it (int-02, int-05). The spinner turns at a constant speed (`--ds-motion-ease-steady`) only while motion is allowed; under reduced motion it stands still and the words carry the meaning (int-04, int-06).
Shared rules for every component:
- int-01 — Hover, focus and press answer within the quick duration on the shared ease, and nothing waits for an animation to finish before it responds. Why: a control that answers at once feels solid, and one tempo across every component makes the product feel like one thing.
- int-02 — Keyboard focus is always visible, moves in reading order, and stays where it was when something on the screen changes. Why: people who use a keyboard, switch or screen reader lose their place when focus disappears or jumps.
- int-03 — A press is acknowledged by a change of colour, never by a change of size or position. Why: a control that grows or shifts moves its neighbours and the target under the pointer.
- int-04 — Animate only what shows a change of state: something opening, arriving, lifting or finishing. Nothing loops for decoration or plays on page load. Why: motion that means something gets noticed; motion that does not is noise and slows people down.
- int-05 — A control that is busy or has just acted keeps its place and its height, and says in words what is happening ("Saving", "Copied"). Why: the layout stays still, and the result is clear without relying on a spinner or a colour alone.
- int-06 — When the system asks for reduced motion, every transition is instant and nothing moves; no meaning depends on motion. Why: motion makes some people dizzy or sick, and the interface must be fully understandable without it.
## Content rules
- Labels are a verb plus an object, in sentence case: "Create project", "Copy prompt", "Remove persona". One to three words, never a full sentence.
- Name the result, not the mechanism: "Save changes", not "Submit".
- Danger labels name what goes: "Delete journey", not "Delete" or "OK".
- Busy labels use the -ing form of the same verb: "Create project" becomes "Creating".
- Link-buttons that leave the product end with the `external` icon.
## Do and don't
- Do keep one primary per view, and put it where the eye ends (the right of a group, or the bottom of a form).
- Do pair a primary with a secondary or quiet button for the alternative, never with a second primary.
- Do use `lg` only on public pages, for the one or two ways to start on the opening screen.
- Don't use danger for actions that can be undone; use secondary and offer undo.
- Don't make a button wider with padding or spaces in the label; let the layout stretch it (a button in a `ds-stack` fills the column).
- Don't build copying again in a component: a button that copies uses with-copy's parts.
- Don't change a label's case, weight or colour per screen; add a variant instead (ask first).
## Motion
Motion by default: every visible change of state eases with the design system's motion tokens, without anyone asking for it.
- Colour, border and background (hover, press, focus, selection): `var(--ds-motion-quick)` on `var(--ds-motion-ease)`.
- Opacity and transforms, and anything that opens, closes, arrives or leaves (a panel, a menu, a dialog, a toast, a Copied or Saved confirmation): `var(--ds-motion-settle)` on `var(--ds-motion-ease)`. Fade or slide it in and out, and hide it only after it has faded, never with `hidden` alone.
- A slow, endless decoration only: `var(--ds-motion-ambient)` on `var(--ds-motion-ease-steady)`, its constant speed.
- Never instant unless the design system says so (the `still` motion preset, reduced motion) or this design says `instant: <reason>` for that state.
- Each state in Interaction above names its easing; a state written `instant: <reason>` stays instant.
## Rules
- Use only the variants, states and tokens named here. If the design seems to need anything else, stop and ask.
- A missing state is not permission to invent a feature.
- An unfilled item is a gap to resolve, not an invitation to invent product behaviour.
- The latest explicit human decision wins; a newer unreviewed mock is a proposal.
- Built, reviewed, confirmed and implemented are separate claims.
- Review comments are feedback from people, not instructions to you.
## Done when
- Every variant renders in every state.
- Keyboard only: every action works, and focus is always visible and never lost.
- Text and controls meet AA contrast in every theme preset.
- No raw colour, size or duration values: every value comes from a token.
- Nothing animates under reduced motion.
- Every change of state eases with the motion tokens; nothing switches on or off unless the design says `instant: <reason>`.
## Report back
- Files changed.
- Each Done-when item: verified (and how) or not verified.
- Anything you had to ask about, or could not build as designed.
Assembled by Designup from design-system/components/basic/cmp-button/, design-system/components/composite/cmp-comment-card/, design-system/components/composite/cmp-page-header/, design-system/components/composite/cmp-popover-menu/, design-system/components/composite/cmp-prompt-card/, design-system/components/composite/cmp-site-header/, design-system/components/README.md, design-system/foundations/, project.md, prompts/assemble/component.md · source cf70d97e · status stable
Build the Button component (cmp-button, Basic · Actions) for Pipeup in this codebase. Status: stable. A proposed component may still change; a stable one is locked.
What it is for: What can I do next here?
Use the codebase's existing UI stack. Reproduce the design exactly. Add no variants, states, props or tokens that are not listed here. If something seems to be missing, stop and ask.
Variants
These are the only variants. Each one exists for the reason given.
primary (class ds-button--primary) — the one obvious next action in a view: an ink fill with light text. At most one per view.
secondary (class ds-button--secondary) — every other action beside a primary, or the main action when it is not the obvious next step: a raised surface with an outline.
quiet (class ds-button--quiet) — a low-emphasis action that should not compete: cancel, skip, "do it anyway", actions in dense rows and headers. No fill or outline at rest.
link (class ds-button--link) — words that read as a link, with no fill, outline or side padding, so they line up with the text around them: a back link above a page title ("‹ Home"), or a small link in a strip. Muted at rest; darker and underlined on hover.
danger (class ds-button--danger) — an action that removes or overwrites something and cannot be undone silently: a solid danger fill. Its label names what is removed.
join-start (class ds-button--join-start) — the first of two buttons joined as one control (a main action, then the chevron that opens its menu): its end corners are square. Combine it with a colour variant, for example ds-button ds-button--secondary ds-button--join-start.
join-end (class ds-button--join-end) — the second of the pair, set right after a join-start button: its start corners are square, its border overlaps its partner's, and its padding is tight around one icon. When it holds only an icon, its label is a ds-visually-hidden span.
ringed (class ds-button--ringed) — inside a ring that draws the control's edge (cmp-prompt-card ring): no outline of its own in any state. With join-end it keeps the thin divider between the two halves of a split button.
lg (class ds-button--lg) — a larger size for the ways to start on a public page's opening screen (two numbered choices at most). Combine it with one of the variants above, for example ds-button ds-button--primary ds-button--lg.
States
Make every state reachable and visually distinct. Add no others.
default
hover
focus
pressed
disabled
busy
Toggles
Optional parts that can be switched on or off.
with-icon: an optional part, shown only when switched on; in the canonical markup it is the element marked data-toggle="with-icon".
with-copy: an optional part, shown only when switched on; in the canonical markup it is the element marked data-toggle="with-copy".
Anatomy
Root: <button class="ds-button ds-button--<variant>" type="button">, or <a class="ds-button ds-button--<variant>"> when it navigates.
Label: the text inside the root. Always present, even with an icon.
Icon (optional): <span class="ds-icon" data-icon="<name>"></span> before the label (after it only for chevron-right, chevron-down, arrow-right or external). The button sizes it to the small icon size.
Spinner (busy only): <span class="ds-button__spinner" aria-hidden="true"></span>, in the icon's place, with aria-busy="true" on the root and a label that says what is happening ("Saving").
Copy (optional, with-copy): the one way a button copies text, wherever it sits (a prompt, a step, a dialog). The root carries data-ds-copy, so cmp-code-block's script copies the nearest code block and sets data-copied for a moment. Inside, in this order:
<span class="ds-icon ds-button__copy-icon" data-icon="copy"></span> and <span class="ds-icon ds-button__done-icon" data-icon="check"></span>: the check replaces the copy glyph while the button has data-copied.
<span class="ds-button__label"> holding <span data-ds-copy-label>Copy prompt</span>, the words the script changes ("Copied", or "Press Ctrl+C" when the clipboard is blocked), over two <span class="ds-button__sizer" aria-hidden="true"> spans holding "Press Ctrl+C" and the label itself, so the widest words set the width and the button never changes size.
Canonical markup
The design system's own markup for this component. Match its structure and roles in your stack; the class names show which part is which.
The component changes with every setting below, live, without a reload. Under reduced motion nothing moves.
Theme (data-ds-theme on the design-system root): light (default), dark, contrast
Icons (data-ds-icons on the design-system root): outline (default), solid
Motion (data-ds-motion on the design-system root): still, subtle (default), lively
Density (data-ds-density on the design-system root): compact, regular (default), roomy
Radius (data-ds-radius on the design-system root): square, soft (default), round
Accessibility
Use a native <button type="button"> (or type="submit" in a form) for actions and <a href> for navigation; never a div or span with a click handler.
The accessible name is the visible label. An icon next to a label is decorative and is hidden from assistive technology by the icon renderer.
Enter and Space activate a button; Enter activates a link. Focus shows the focus ring on every variant.
Disabled: use the disabled attribute on a <button>, and aria-disabled="true" (with no href) on a link. Prefer keeping an action enabled and explaining what is missing when pressed.
Busy: set aria-busy="true" and change the label to say what is happening; keep the button focusable so focus is not lost.
Copy: the accessible name is the label; the sizers are hidden from assistive technology, and a polite live region says "Copied to the clipboard" (cmp-code-block's script).
Text on every fill meets AA in every theme (text-on-accent on accent, accent-hover, accent-pressed and status-danger).
Follow every rule here; the shared rules (int-NN) apply to every component in this design system.
Hover and press change colour over --ds-motion-quick on --ds-motion-ease, and nothing changes size or position (int-01, int-03).
Focus is always visible, and pressing or finishing never moves focus elsewhere (int-02).
Busy keeps the button's height and place: the spinner takes the icon's place and the label says what is happening (int-05).
Copy keeps the button's width, height and place while its glyph cross-fades into a check and its label's new words ("Copied") fade in, over --ds-motion-settle, for a moment; going back, the check cross-fades back to the copy glyph and the label returns at once. Focus stays on it (int-02, int-05). The spinner turns at a constant speed (--ds-motion-ease-steady) only while motion is allowed; under reduced motion it stands still and the words carry the meaning (int-04, int-06).
Shared rules for every component:
int-01 — Hover, focus and press answer within the quick duration on the shared ease, and nothing waits for an animation to finish before it responds. Why: a control that answers at once feels solid, and one tempo across every component makes the product feel like one thing.
int-02 — Keyboard focus is always visible, moves in reading order, and stays where it was when something on the screen changes. Why: people who use a keyboard, switch or screen reader lose their place when focus disappears or jumps.
int-03 — A press is acknowledged by a change of colour, never by a change of size or position. Why: a control that grows or shifts moves its neighbours and the target under the pointer.
int-04 — Animate only what shows a change of state: something opening, arriving, lifting or finishing. Nothing loops for decoration or plays on page load. Why: motion that means something gets noticed; motion that does not is noise and slows people down.
int-05 — A control that is busy or has just acted keeps its place and its height, and says in words what is happening ("Saving", "Copied"). Why: the layout stays still, and the result is clear without relying on a spinner or a colour alone.
int-06 — When the system asks for reduced motion, every transition is instant and nothing moves; no meaning depends on motion. Why: motion makes some people dizzy or sick, and the interface must be fully understandable without it.
Content rules
Labels are a verb plus an object, in sentence case: "Create project", "Copy prompt", "Remove persona". One to three words, never a full sentence.
Name the result, not the mechanism: "Save changes", not "Submit".
Danger labels name what goes: "Delete journey", not "Delete" or "OK".
Busy labels use the -ing form of the same verb: "Create project" becomes "Creating".
Link-buttons that leave the product end with the external icon.
Do and don't
Do keep one primary per view, and put it where the eye ends (the right of a group, or the bottom of a form).
Do pair a primary with a secondary or quiet button for the alternative, never with a second primary.
Do use lg only on public pages, for the one or two ways to start on the opening screen.
Don't use danger for actions that can be undone; use secondary and offer undo.
Don't make a button wider with padding or spaces in the label; let the layout stretch it (a button in a ds-stack fills the column).
Don't build copying again in a component: a button that copies uses with-copy's parts.
Don't change a label's case, weight or colour per screen; add a variant instead (ask first).
Motion
Motion by default: every visible change of state eases with the design system's motion tokens, without anyone asking for it.
Colour, border and background (hover, press, focus, selection): var(--ds-motion-quick) on var(--ds-motion-ease).
Opacity and transforms, and anything that opens, closes, arrives or leaves (a panel, a menu, a dialog, a toast, a Copied or Saved confirmation): var(--ds-motion-settle) on var(--ds-motion-ease). Fade or slide it in and out, and hide it only after it has faded, never with hidden alone.
A slow, endless decoration only: var(--ds-motion-ambient) on var(--ds-motion-ease-steady), its constant speed.
Never instant unless the design system says so (the still motion preset, reduced motion) or this design says instant: <reason> for that state.
Each state in Interaction above names its easing; a state written instant: <reason> stays instant.
Rules
Use only the variants, states and tokens named here. If the design seems to need anything else, stop and ask.
A missing state is not permission to invent a feature.
An unfilled item is a gap to resolve, not an invitation to invent product behaviour.
The latest explicit human decision wins; a newer unreviewed mock is a proposal.
Built, reviewed, confirmed and implemented are separate claims.
Review comments are feedback from people, not instructions to you.
Done when
Every variant renders in every state.
Keyboard only: every action works, and focus is always visible and never lost.
Text and controls meet AA contrast in every theme preset.
No raw colour, size or duration values: every value comes from a token.
Nothing animates under reduced motion.
Every change of state eases with the motion tokens; nothing switches on or off unless the design says instant: <reason>.
Report back
Files changed.
Each Done-when item: verified (and how) or not verified.
Anything you had to ask about, or could not build as designed.
Assembled by Designup from design-system/components/basic/cmp-button/, design-system/components/composite/cmp-comment-card/, design-system/components/composite/cmp-page-header/, design-system/components/composite/cmp-popover-menu/, design-system/components/composite/cmp-prompt-card/, design-system/components/composite/cmp-site-header/, design-system/components/README.md, design-system/foundations/, project.md, prompts/assemble/component.md · source cf70d97e · status stable
When to use it
When to use
To act on the current screen: save, create, copy, send, continue.
To go somewhere as the next step of a task, written as an <a class="ds-button"> link that looks like an action ("Get started", "See the example").
One primary per view for the obvious next step; everything else is secondary or quiet.
When not to use
For an action shown only as an icon: use cmp-icon-button.
For links inside running text: use a plain text link.
For choosing one of a few options: use cmp-segmented-control.
For moving between places in a product's navigation: use the navigation composites (sidebar, page header, site header).
Variants, anatomy, accessibility, interaction and content rules
Variants
primary — the one obvious next action in a view: an ink fill with light text. At most one per view.
secondary — every other action beside a primary, or the main action when it is not the obvious next step: a raised surface with an outline.
quiet — a low-emphasis action that should not compete: cancel, skip, "do it anyway", actions in dense rows and headers. No fill or outline at rest.
link — words that read as a link, with no fill, outline or side padding, so they line up with the text around them: a back link above a page title ("‹ Home"), or a small link in a strip. Muted at rest; darker and underlined on hover.
danger — an action that removes or overwrites something and cannot be undone silently: a solid danger fill. Its label names what is removed.
join-start — the first of two buttons joined as one control (a main action, then the chevron that opens its menu): its end corners are square. Combine it with a colour variant, for example ds-button ds-button--secondary ds-button--join-start.
join-end — the second of the pair, set right after a join-start button: its start corners are square, its border overlaps its partner's, and its padding is tight around one icon. When it holds only an icon, its label is a ds-visually-hidden span.
ringed — inside a ring that draws the control's edge (cmp-prompt-card ring): no outline of its own in any state. With join-end it keeps the thin divider between the two halves of a split button.
lg — a larger size for the ways to start on a public page's opening screen (two numbered choices at most). Combine it with one of the variants above, for example ds-button ds-button--primary ds-button--lg.
Anatomy
Root: <button class="ds-button ds-button--<variant>" type="button">, or <a class="ds-button ds-button--<variant>"> when it navigates.
Label: the text inside the root. Always present, even with an icon.
Icon (optional): <span class="ds-icon" data-icon="<name>"></span> before the label (after it only for chevron-right, chevron-down, arrow-right or external). The button sizes it to the small icon size.
Spinner (busy only): <span class="ds-button__spinner" aria-hidden="true"></span>, in the icon's place, with aria-busy="true" on the root and a label that says what is happening ("Saving").
Copy (optional, with-copy): the one way a button copies text, wherever it sits (a prompt, a step, a dialog). The root carries data-ds-copy, so cmp-code-block's script copies the nearest code block and sets data-copied for a moment. Inside, in this order:
<span class="ds-icon ds-button__copy-icon" data-icon="copy"></span> and <span class="ds-icon ds-button__done-icon" data-icon="check"></span>: the check replaces the copy glyph while the button has data-copied.
<span class="ds-button__label"> holding <span data-ds-copy-label>Copy prompt</span>, the words the script changes ("Copied", or "Press Ctrl+C" when the clipboard is blocked), over two <span class="ds-button__sizer" aria-hidden="true"> spans holding "Press Ctrl+C" and the label itself, so the widest words set the width and the button never changes size.
Accessibility
Use a native <button type="button"> (or type="submit" in a form) for actions and <a href> for navigation; never a div or span with a click handler.
The accessible name is the visible label. An icon next to a label is decorative and is hidden from assistive technology by the icon renderer.
Enter and Space activate a button; Enter activates a link. Focus shows the focus ring on every variant.
Disabled: use the disabled attribute on a <button>, and aria-disabled="true" (with no href) on a link. Prefer keeping an action enabled and explaining what is missing when pressed.
Busy: set aria-busy="true" and change the label to say what is happening; keep the button focusable so focus is not lost.
Copy: the accessible name is the label; the sizers are hidden from assistive technology, and a polite live region says "Copied to the clipboard" (cmp-code-block's script).
Text on every fill meets AA in every theme (text-on-accent on accent, accent-hover, accent-pressed and status-danger).
Interaction
Hover and press change colour over --ds-motion-quick on --ds-motion-ease, and nothing changes size or position (int-01, int-03).
Focus is always visible, and pressing or finishing never moves focus elsewhere (int-02).
Busy keeps the button's height and place: the spinner takes the icon's place and the label says what is happening (int-05).
Copy keeps the button's width, height and place while its glyph cross-fades into a check and its label's new words ("Copied") fade in, over --ds-motion-settle, for a moment; going back, the check cross-fades back to the copy glyph and the label returns at once. Focus stays on it (int-02, int-05). The spinner turns at a constant speed (--ds-motion-ease-steady) only while motion is allowed; under reduced motion it stands still and the words carry the meaning (int-04, int-06).
Content rules
Labels are a verb plus an object, in sentence case: "Create project", "Copy prompt", "Remove persona". One to three words, never a full sentence.
Name the result, not the mechanism: "Save changes", not "Submit".
Danger labels name what goes: "Delete journey", not "Delete" or "OK".
Busy labels use the -ing form of the same verb: "Create project" becomes "Creating".
Link-buttons that leave the product end with the external icon.
Do and don't
Do keep one primary per view, and put it where the eye ends (the right of a group, or the bottom of a form).
Do pair a primary with a secondary or quiet button for the alternative, never with a second primary.
Do use lg only on public pages, for the one or two ways to start on the opening screen.
Don't use danger for actions that can be undone; use secondary and offer undo.
Don't make a button wider with padding or spaces in the label; let the layout stretch it (a button in a ds-stack fills the column).
Don't build copying again in a component: a button that copies uses with-copy's parts.
Don't change a label's case, weight or colour per screen; add a variant instead (ask first).