Skip to content

Button

The call to action. Solid for the one primary action of a view, outline for the action beside it.

In Figma: CTA Button (node 25:1799). In code: components/ui/button.tsx

Example

A link as a button
A link as a button
import { Button, buttonClasses } from '@/components/ui/button';

<Button>Tilføj til kurv</Button>
<Button variant="outline">Find forhandler</Button>
<a className={buttonClasses({ variant: 'outline' })} href="/kontakt">Kontakt os</a>

Props

PropTypeDefaultWhat it does
variant'solid' | 'outline''solid'Solid is filled in the button colour of the theme. Outline is a hairline in the same colour.
...buttonButtonHTMLAttributesEverything a native button takes: onClick, disabled, type (defaults to "button").

Do

  • One solid button per view. It is the thing the page wants done.
  • Write the label as the action: "Tilføj til kurv", not "OK".
  • Use buttonClasses on a link when the action navigates.

Do not

  • Do not colour a button with Flare. Flare is for the logo only.
  • Do not set your own padding, radius or font on it.
  • Do not put two solid buttons side by side.

Accessibility

  • A native button: keyboard and screen reader work without script.
  • Focus shows a ring in the text colour. Figma has no focus state yet, so the ring is ours until Peter draws one.

Tokens it uses

  • color.button.solid.fill
  • color.button.solid.text
  • color.button.outline.stroke
  • color.button.outline.text
  • radius.sm
  • type.button.md
  • component.button.padding-x
  • component.button.padding-top
  • component.button.padding-bottom