Button
Trigger an action. Use ButtonLink when the control changes the URL.
Sizes
Default in this port is small (32px), matching product chrome. medium is 40px, large is 48px.
Variants
Shapes
Icon-only buttons need svg-only and an aria-label.
Prefix and suffix
Loading and disabled
Link
Custom
Override foreground, background, and border for normal / hover / active.
1
<CustomButton
2
:normal="{ foreground: '#fff', background: 'var(--ds-blue-700)', border: 'var(--ds-blue-700)' }"
3
:hover="{ foreground: '#fff', background: '#0B7BFE', border: 'var(--ds-blue-700)' }"
4
:active="{ foreground: '#fff', background: 'var(--ds-blue-700)', border: 'var(--ds-blue-700)' }"
5
>
6
Upgrade to Pro
7
</CustomButton>
Best practices
- Button mutates state. ButtonLink changes the URL. More than one related action in a row → Menu or Split Button.
- Primary is
default. Supporting issecondary. Destructive confirmations useerror. - Form submit uses
type-name="submit". Visual variant stays onvariant/type. - Pass
loadinginstead of swapping a spinner so the control stays focusable. - Disable only when the action is impossible. Explain why with a Tooltip.
- Aliases
ghost→ tertiary andoutline→ secondary exist for older screens. New code should use Hesoyam names.