ComponentsDraftWCAG 2.1/2.2 AAZero Gradients
@hahlex/millar-uiButton
Primary action control with 7 semantic variants, async double-click protection (aria-busy), high-contrast outlined danger variant, and 2px keyboard focus ring.
Interactive Playground
Live component specimen driven directly by Millar tokens in Light and Dark mode.
Lock 3rd button (disabled)
Interactive event readoutClick any button above to test async busy-guard locking or live press events.
Props API
Usage Guidelines & Agent Guardrails
When to use
- Use 'primary' at most once per PageHeader or Dialog footer for the single main action.
- Use 'white' or 'secondary' for supporting actions and toolbar buttons.
- Use 'danger' paired with ConfirmDialog for irreversible destructive actions.
Maintains >= 40px default height (44px lg) and >= 32px icon-only dimensions; wraps cleanly inside PageHeader action groups below 640px.
Anti-Hallucination Guardrails (AI & Human)
- Do NOT pass variant='destructive', variant='outline', or variant='link' (use 'danger', 'white', or 'ghost').
- Do NOT render iconOnly={true} without a descriptive aria-label.
- Do NOT apply CSS gradients or drop shadows to Button.
- Do NOT render solid crimson background with white text in dark mode (fails contrast at 2.51:1); 'danger' uses outlined --status-error.
Accessibility & Keyboard Contract
Native <button type='button'> defaultaria-busy during async submit without dropping focusRequired aria-label when iconOnly={true}