Button and extends MantineButtonProps with an explicit onClick typing — always a native <button> element, never a <div>.
Status: AI-Ready —
aria_correct, structure_correct, states_complete, tokens_valid, and no_invented_styles all pass. Token contract is closed at 15 component-tier tokens. Spec last verified 2026-06-08.When to use
- Form actions: submit, cancel, reset
- Page-level actions: Create, Save, Publish
- Destructive actions: Delete, Revoke — always paired with a confirm step or undo
- Modal footer actions
When not to use
- Navigation to another page. Use a link (
<a>or your router’s<Link>). - Toggling a single setting. Use Switch.
- A clickable icon with no label. Use IconButton (not yet specced — add
aria-labelas a stopgap).
Anatomy
Button is composed of five semantic parts. Onlyroot and label are always present.
In the loading state the HTML structure becomes:
Variants
Sizes
Pass
size as a prop: <Button size="sm">. The default is md.
Interaction states
Usage
- ✅ Save changes, Revoke session, Delete user, Add member
- ❌ Click here, OK, Yes, Save (when a more specific label is possible)
Accessibility
Token contract
15 component-tier tokens. Tokens follow the 3-tier cascade: component → semantic → primitive. Never reference a primitive directly in component code, and never hardcode a hex value.
Dark mode is handled automatically — the same token names resolve to different primitive values in dark mode. You don’t need to add any theme-switching logic to your components.
TypeScript usage
Button exportsButtonProps alongside the component so you can type your own wrappers: