IconButton
Square icon-only control with the same surface tokens as Button.
When to use
Use IconButton when you need square icon-only control with the same surface tokens as button.
Import
TypeScript
import { IconButton } from '@gzodo/ui'Use IconButton when the action is identified by an icon. Always set title or aria-label so the control has a name. The hit target is square and matches the control size scale.
Examples
4Variants
Same variant set as Button. The icon inherits currentColor and is sized with 1em.
Sizes
Square edges: 22, 28, 32, and 37. Icon font size grows with the size (14 / 16 / 18 / 18).
Color
Pass a semantic
color, or pass danger / success / warning as variant — that form is remapped to color.Loading and disabled
Loading replaces the icon with a spinner and sets aria-busy. Disabled removes the button from the tab order.
IconButton
9IconButton
Property
Description
Type
Default
sizeFixed height of the control.
'sm' | 'md' | 'lg' | 'xl''md'variantSurface treatment. Primary is the main action.
'primary' | 'secondary' | 'outline' | 'ghost' | 'text' | 'base' | 'default'—
colorSemantic color layered on top of the variant.
'danger' | 'success' | 'warning'—
fullWidthStretch the control to the container width.
booleanfalsedisabledBlocks interaction and lowers opacity.
booleanfalseclassNameExtra classes, merged with the component classes.
string—
childrenThe icon. Size it with 1em so it follows the control.
ReactNode—
isLoadingReplaces the icon with a spinner.
booleanfalsetitleAccessible name. Prefer this or aria-label.
string—