primitives · @awesome-ds/react
Button
Primary actions with loading and disabled states.
State matrix
idle
hover
focus
active
disabled
loading
Anatomy
- native button
- label
- loading indicator
Keyboard contract
Enter and Space activate once; disabled and loading states suppress activation.
Screen-reader contract
The native button name remains stable while aria-disabled and busy state are exposed.
Content rules
- Begin labels with a specific verb.
- Keep loading text consistent with the action.
Public API
| Prop | Type | required | Description |
|---|---|---|---|
children | ReactNode | required | Visible accessible label |
variant | "primary" | "secondary" | "ghost" | "danger" | — | Semantic action emphasis |
size | "sm" | "md" | "lg" | — | Tokenized control size |
loading | boolean | — | Prevents duplicate actions |
…native | ButtonHTMLAttributes<HTMLButtonElement> | — | Native button attributes |
Adaptation contracts
- RTL
- Preserve icon meaning, use logical spacing, and mirror only directional artwork.
- High contrast
- Keep native outlines and a visible text or border affordance in forced colors.
- Reduced motion
- Remove hover travel and loading flourish while retaining immediate state feedback.
Verification IDs
Live
Live
Copyable example
import { Button } from "@awesome-ds/react";
<Button loading>Save</Button>