Button
Starts an action.
import { Button } from '@rajatweb/argent'
<Button onClick={save}>Save changes</Button>
<Button variant="outline">Cancel</Button>
<Button variant="danger" loading>Delete</Button>Props
| Prop | Type | Default | What it does |
|---|---|---|---|
disabled | boolean | ||
fullWidth | boolean | Fills the width of its container. | |
loading | boolean | Shows a spinner and ignores presses. | |
size | 'sm' | 'md' | 'lg' | 'md' | |
variant | 'danger' | 'solid' | 'outline' | 'ghost' | 'solid' |
Accessibility
- Loading keeps focus and announces that it is busy.
- Small buttons still reach a 44-point target on React Native.
Do
- Use one solid button per view.
- Name the action: "Delete project".
Don’t
- Use danger for anything that can be undone.