Icon Button
IconButton Props
IconButton inherits most Button props but does not expose isIconOnly, because it is always icon-only.
| Name | Type | Default | Description |
|---|---|---|---|
label | string | required | Accessible name for the button. |
variant | 'primary' | 'secondary' | 'ghost' | 'destructive' | 'secondary' | Visual hierarchy and semantic variant. |
size | 'sm' | 'md' | 'lg' | 'md' | Square control size. |
elevation | 'none' | 'low' | 'med' | 'high' | 'none' | Resting shadow depth for a standalone floating button. |
isDisabled | boolean | false | Disables interaction. A tooltip switches this to aria-disabled so focus remains available. |
isLoading | boolean | false | Shows loading state, sets aria-busy, and disables non-interruptible activation. |
isInterruptible | boolean | false | Allows clickAction to run again while earlier work is pending. |
clickAction | (event: MouseEvent) => void | Promise<void> | — | Action function that automatically drives pending state. |
tooltip | string | — | Supplementary hint shown on hover and keyboard focus. |
href | string | — | Renders the enabled root as a link when present. |
width | number | string | — | Button width. Numbers become pixels; CSS strings are used as supplied. |
These props are also inherited. See Button props for their definitions.
type.name.value.form.loadingLabel.as.target.rel.
Slot
- The default slot is required.
- The default slot must contain one icon that represents the action.
IconButtondoes not display text.IconButtondoes not provide anendslot.
Accessible name
Provide an accurate label. Without it, assistive technology cannot identify the button's purpose.
tooltip provides additional information. Do not use it instead of label.
Events
The click event passes a MouseEvent.
Template ref
IconButton exposes element. Its type is HTMLButtonElement | HTMLAnchorElement | HTMLElement | null.
Native attributes
The root element receives:
- HTML attributes.
aria-*attributes.data-*attributes.class.style.- Native event listeners.