Buttons
Shared components, documented once and used everywhere.
Button DS-BTN-001
Use for actions. This preview uses the same CSS classes as the reusable component.
Live component
Change a property to inspect the component.
Responsive previews
These are container-width demonstrations. Verify real mobile, tablet and desktop browsers before approval.
Component controls
Controls change the live component state, not its design tokens. Changes are not saved or published.
Resolved styling
These values are read directly from the rendered button using the browser's computed styles.
| Property | Computed value | Source |
|---|---|---|
| Enable JavaScript to inspect resolved styling. | ||
Component contract
| Property | Supported values | Default |
|---|---|---|
| variant | primary, secondary, outline, danger | primary |
| size | sm, medium, lg | medium |
| disabled | true / false | false |
| loading | true / false | false |
Implementation
Source of truth: css/components.css and css/tokens.css. Do not override per page.
Usage guidance
For clear actions with accessible text. Use primary for the main action in a region; danger for destructive actions requiring appropriate confirmation.
Using disabled controls without explaining why, using colour alone to communicate meaning, or adding inline styles to individual buttons.
Accessibility and release criteria
- Native button semantics and keyboard activation
- Visible keyboard focus; loading state announced to assistive technology
- Text contrast and target sizing must be checked for every variant
- Check at 320px, 375px, 768px, 1024px and desktop widths
- Test zoom at 200% and reduced-motion preference
These are acceptance requirements, not a claim that all checks have passed.
Change history
| Release | Change | Status |
|---|---|---|
| v0.1.3 | Dedicated asset documentation, computed styles, responsive examples | Review |
| v0.1.0 | Initial button variants and state playground | Prototype |