Icon Button

The Icon Button component renders a button with an icon. It supports various actions, including external links and loading states.

Usage

Default IconButton

<IconButton icon={FaPlus} ariaLabel="Add" />

Props

Sortable data table
PropTypeDefaultDescription
iconReact.ReactNode-The icon element to display inside the button (e.g., FaPlus). Required.
theme"primary" | "secondary" | "tertiary" | "quaternary" | "clear"Configured DefaultTheme color for the button.
state"success" | "error" | "warning"-State variant (success, warning, error).
size"xs" | "small" | "medium" | "large" | "xl"Configured DefaultSize of the button.
rounding"none" | "small" | "medium" | "large"Configured DefaultBorder radius/rounding of the button.
shadow"none" | "light" | "medium" | "strong" | "intense"Configured DefaultShadow effect for the button.
outlinebooleanfalseShow button as outlined style.
loadingbooleanfalseDisplays a spinner instead of the icon when true.
disabledbooleanfalseDisables the button and makes it non-interactive.
hrefstring-If set, renders as a link (<a> or custom LinkComponent).
isExternalbooleanfalseIf true, opens the link in a new tab (for external links).
ariaLabelstring-Accessible label for screen readers (required if only icon).
titlestring-Native title tooltip (optional, falls back to ariaLabel).
tabIndexnumber-Tab order for keyboard navigation.
onClick(event) => void-Callback fired on button click.
onKeyDown(event) => void-Callback fired on keydown events.
classNamestring-Additional CSS class(es) to apply.
type"button" | "submit" | "reset""button"Button type (button, submit, reset).
data-testidstring"icon-button"Custom data-testid for testing.