IconButton
Actions

IconButton

Square icon-only button with the same variant and size scale as Button.

Props

IconButton extends ButtonHTMLAttributes<HTMLButtonElement>. It uses an icon prop in place of children and requires an aria-label for accessibility.

IconButtonProps props
PropTypeDefaultDescription
iconReactNode—The icon to display.
aria-labelstring—Accessible label for the button.
variantButtonVariant"ghost""default" | "primary" | "outline" | "ghost" | "danger"
sizeButtonSize"md""sm" | "md"
disabledboolean—Prevents interaction.
loadingboolean—Swaps the icon for a Spinner and disables the button.

Examples

Variants

IconButton variants

Sizes

IconButton sizes

Disabled

Disabled IconButton
ImportTSX
import { IconButton } from "@solarius/onset";
import { IconSearch } from "@tabler/icons-react";

<IconButton icon={<IconSearch size={14} />} aria-label="Search" />;