Forms
Button
Action trigger with ten variants, three sizes, optional icons, a loading spinner, and fullWidth. Built over MUI Button but exposes only the agnostic Hub API.
Examples
Variants
Loading preview
<Button variant="primary">Save</Button>
<Button variant="outlined">Cancel</Button>
<Button variant="danger">Delete</Button>Status (outlined)
Loading preview
<Button variant="outlined-success">Approve</Button>
<Button variant="outlined-warning">Review</Button>
<Button variant="outlined-error">Reject</Button>Loading
Loading preview
<Button loading>Saving</Button>API
| Prop | Type | Default | Description |
|---|---|---|---|
variant | 'primary' | 'secondary' | 'danger' | 'outlined' | 'outlined-secondary' | 'outlined-success' | 'outlined-warning' | 'outlined-error' | 'text' | 'text-secondary' | primary | Visual style. The outlined-success / -warning / -error variants are status-colored outlined buttons. |
size | 'small' | 'medium' | 'large' | medium | Size of the button. |
loading | boolean | false | Show a spinner and block interaction. |
fullWidth | boolean | false | Stretch to fill the container width. |
leftIcon / rightIcon | ReactNode | none | Icon before or after the label. |
disabled | boolean | false | Disable the button. |
Styling and attributes
Like every component, Button accepts the universal token style props (m, p, sx, display, responsive maps, ...) and forwards standard DOM attributes (id, data-*, aria-*, event handlers) to the underlying element. See Styling for the full API.
Guidelines
Do
- Use one primary button per view for the main action.
- Use danger for destructive actions like delete.
Avoid
- Do not import Button from @mui/material; always use @hub/ds-components.
- Do not hardcode colors or sizes; the variant and size props are the API.