IconButton
A button that shows only an icon.
import { IconButton } from '@rajatweb/argent'
<IconButton label="Add item" onClick={add}>
<PlusIcon aria-hidden />
</IconButton>Props
| Prop | Type | Default | What it does |
|---|---|---|---|
label required | string | Accessible name, since the icon alone has none. | |
disabled | boolean | ||
loading | boolean | Shows a spinner and ignores presses. | |
size | 'sm' | 'md' | 'lg' | 'md' | |
variant | 'danger' | 'solid' | 'outline' | 'ghost' | 'solid' |
Accessibility
- `label` is required, because an icon has no name of its own.
Do
- Use icons people already know.
Don’t
- Hide a main action behind an icon.