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
Props
| Prop | Type | Default | What it does |
|---|---|---|---|
variant | 'solid' | 'outline' | 'solid' | Solid is filled in the button colour of the theme. Outline is a hairline in the same colour. |
...button | ButtonHTMLAttributes | Everything 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