ComponentsFormIconButton

IconButton

Icon-only button with tooltip, badge, toggle and FAB support. 6 variants, 5 sizes.

6 variants5 sizesToggleBadgeTooltipFABLoading

Overview

Icon-only button with tooltip, badge, toggle and FAB support. 6 variants, 5 sizes.

Icon button variants

Live preview

Every icon-only action needs a concise accessible name.

LikeLikeLikeLikeLikeUnlike
IconButtonExample.tsx
tsx
import { IconButton } from 'omverse-ui'
 
// 6 variants
<IconButton icon="heart" variant="filled" aria-label="Like" />
<IconButton icon="heart" variant="outlined" aria-label="Like" />
<IconButton icon="heart" variant="tonal" aria-label="Like" />
<IconButton icon="heart" variant="ghost" aria-label="Like" />
<IconButton icon="heart" variant="standard" aria-label="Like" />
<IconButton icon="heart" variant="destructive" aria-label="Like" />
 
// gradient is a boolean prop (not a variant) — combine with filled:
<IconButton icon="heart" variant="filled" gradient aria-label="Like" />

Use icon buttons only for actions with widely understood symbols and provide an aria-label that describes the action.

Anatomy

  • Root container and spacing boundary.
  • Primary content and optional secondary metadata.
  • State indicators and utility affordances (icons, badges, controls).
  • Optional helper text, grouping, and behavioral wrappers.

When to use

  • Choose IconButton when a repeated, structured interaction is required.
  • Use it for clear, consistent operations across similar surfaces.
  • Use in forms, lists, and action workflows where clarity matters.

When not to use

  • Do not use only for decorative layout without interaction meaning.
  • Avoid duplicating the same behavior without distinct user context.
  • Prefer simpler HTML or textual content for static, non-interactive labels.

Variants

Component variants should be documented by API props and examples below.

States

Common states include idle, active, disabled, focused, and loading/pending states where applicable.

Behavior

Behavior should remain deterministic and keyboard-friendly, with clear visual feedback for every state transition.

Accessibility

  • Use semantic structure and visible labels whenever possible.
  • Preserve keyboard navigation and focus visibility.
  • Announce status and changes when context requires it.

Content guidelines

  • Prefer short, clear labels.
  • Keep content actions scannable and outcome-oriented.
  • Use consistent wording across similar components.

Examples

Variants

Live preview

6 emphasis levels — filled · outlined · tonal · ghost · standard · destructive. gradient is a boolean prop applied on top of a variant.

Like (filled)Like (outlined)Like (tonal)Like (ghost)Like (standard)Like (destructive)
Like (gradient)variant="filled" gradient
App.tsx
tsx
import { IconButton } from 'omverse-ui'
 
// 6 variants
<IconButton icon="heart" variant="filled" aria-label="Like" />
<IconButton icon="heart" variant="outlined" aria-label="Like" />
<IconButton icon="heart" variant="tonal" aria-label="Like" />
<IconButton icon="heart" variant="ghost" aria-label="Like" />
<IconButton icon="heart" variant="standard" aria-label="Like" />
<IconButton icon="heart" variant="destructive" aria-label="Like" />
 
// gradient is a boolean prop (not a variant) — combine with filled:
<IconButton icon="heart" variant="filled" gradient aria-label="Like" />

Sizes

Live preview

xs · sm · md · lg · xl — all sizes keep a 44 × 44 px minimum touch target

Settings (xs)Settings (sm)Settings (md)Settings (lg)Settings (xl)
App.tsx
tsx
<IconButton icon="settings" size="xs" aria-label="Settings" />
<IconButton icon="settings" size="sm" aria-label="Settings" />
<IconButton icon="settings" size="md" aria-label="Settings" />
<IconButton icon="settings" size="lg" aria-label="Settings" />
<IconButton icon="settings" size="xl" aria-label="Settings" />

Shape

Live preview

circle (default) or square — square pairs well with FAB

Add (circle)Add (square)
App.tsx
tsx
// circle (default)
<IconButton icon="plus" variant="filled" shape="circle" aria-label="Add" />
 
// square
<IconButton icon="plus" variant="filled" shape="square" aria-label="Add" />

Toggle

Live preview

toggle enables a pressed / unpressed state with aria-pressed — click to switch

LikeBookmarkStar
App.tsx
tsx
// Uncontrolled toggle — component manages its own state
<IconButton icon="heart" variant="ghost" toggle aria-label="Like" />
<IconButton icon="bookmark" variant="ghost" toggle aria-label="Bookmark" />
<IconButton icon="star" variant="ghost" toggle aria-label="Star" />
 
// Controlled toggle with pressedIcon
<IconButton
icon="bookmark"
pressedIcon="bookmark"
variant="ghost"
toggle
pressed={saved}
onPressedChange={setSaved}
aria-label="Save"
/>

With badge

Live preview

badge={true} shows a red dot · badge={n} shows a count (capped at 99+)

Notifications3 notifications12 messages99 saved items
App.tsx
tsx
// Dot badge (true)
<IconButton icon="bell" variant="outlined" badge={true} aria-label="Notifications" />
 
// Count badge
<IconButton icon="bell" variant="outlined" badge={3} aria-label="3 notifications" />
<IconButton icon="mail" variant="outlined" badge={12} aria-label="12 messages" />
<IconButton icon="bookmark" variant="outlined" badge={99} aria-label="99 saved items" />

Loading

Live preview

loading replaces the icon with a spinner and disables interaction

App.tsx
tsx
// loading shows a spinner and disables interaction
<IconButton icon="refresh" variant="filled" loading aria-label="Refresh" />
<IconButton icon="upload" variant="outlined" loading aria-label="Upload" />

FAB (Floating Action Button)

Live preview

fab adds an elevation shadow — pair with size='xl' and shape='square' for the classic Material FAB

AddEditAdd (xl)
App.tsx
tsx
// fab adds an elevation shadow — pair with size="xl" for classic FAB
<IconButton icon="plus" variant="filled" fab aria-label="Add" />
<IconButton icon="edit" variant="tonal" fab aria-label="Edit" />
<IconButton icon="plus" variant="filled" fab size="xl" shape="square" aria-label="Add" />

Gradient

Live preview

gradient is a boolean prop — applies a brand gradient on filled and destructive variants

Add (gradient)Delete (gradient)Star (gradient lg)
App.tsx
tsx
// gradient applies a brand gradient background (filled / destructive)
<IconButton icon="plus" variant="filled" gradient aria-label="Add" />
<IconButton icon="trash" variant="destructive" gradient aria-label="Delete" />

Disabled

Live preview

disabled reduces opacity and prevents all interaction

SettingsSettingsSettings
App.tsx
tsx
<IconButton icon="settings" variant="filled" disabled aria-label="Settings" />
<IconButton icon="settings" variant="outlined" disabled aria-label="Settings" />
<IconButton icon="settings" variant="ghost" disabled aria-label="Settings" />

Props / API

Api Props

Props

PropTypeDefaultDescription
iconIconName—Icon to display — required
aria-labelstring—Accessible label — TypeScript-required for icon-only buttons
variant'filled' | 'outlined' | 'tonal' | 'ghost' | 'standard' | 'destructive''ghost'Visual style
size'xs' | 'sm' | 'md' | 'lg' | 'xl''md'Button size (all sizes keep a 44 × 44 px minimum touch target)
shape'circle' | 'square''circle'Button shape
togglebooleanfalseToggleable on / off state with aria-pressed
pressedbooleanundefinedControlled pressed state for toggle mode
onPressedChange(pressed: boolean) => voidundefinedCallback fired when pressed state changes
pressedIconIconNameundefinedIcon shown when toggle is in pressed state
badgeboolean | numberundefinedtrue → red dot · number → count badge (capped at 99+)
tooltipbooleantrueShow a tooltip with the aria-label text on hover / focus
loadingbooleanfalseShows a loading spinner and disables interaction
gradientbooleanfalseApply brand gradient background (filled / destructive variants)
fabbooleanfalseFloating action button style — adds elevation shadow
disabledbooleanfalseDisables the button