IconButton

Icon buttons help people take actions with a single tap.

Usage

IconButton represents a frequent action with one unambiguous icon. Import it from @udixio/ui-react, @udixio/ui-angular or @udixio/ui-svelte. label and icon are required: the icon stays decorative while the stable label names the native control.

Variants

Variants are standard, filled, tonal, and outlined.

Sizes

Sizes range from xSmall to xLarge. Every size retains at least a 48 px touch target regardless of the visible icon size.

Shape and width

shape selects the rounded or squared resting shape; width is narrow, default, or wide. The shared Motion controller morphs the shape on accepted presses by default. Set shapeFeedback="none" to keep it static.

Toggle buttons

Set toggleable for binary actions such as Favorite. pressed is controlled; defaultPressed initializes uncontrolled state. React emits onPressedChange; Angular emits pressedChange; Svelte keeps onPressedChange and also supports bind:pressed. pressedIcon optionally replaces the resting icon while pressed.

Navigation links ignore toggle state. Use aria-current for the current destination instead.

In Svelte, use a normal bind:pressed for the common case. To reject a transition, use a function binding and only assign in its setter when the owner accepts the new value.

Accessibility

Action mode renders a native button with type="button" by default. href switches to a native link. Disabled links lose their destination, receive aria-disabled, and leave the tab order. Focus is visible and icons are decorative.

The accessible label is also shown in a tooltip on hover and keyboard focus. Set tooltip to a string to show different supporting text, or set it to false when the surrounding interface already makes the action explicit.

Migrating to 3.0

Before3.0
iconSelectedpressedIcon
activatedpressed or defaultPressed
onToggletoggleable plus onPressedChange / pressedChange
allowShapeTransformation={false}shapeFeedback="none"
text children as the labelrequired label and icon
implicit tooltip from title/labelautomatic label; customize or hide with tooltip