Skip to content

Action

IconButton

Icon-only button for compact toolbars and controls.

import { IconButton } from '@var-ui/react';

IconButton

Icon-only button for compact toolbars and controls. Shares tone / appearance / size with Button, and always uses layout="icon". Pair with ButtonGroup or Toolbar for dense action rows.

Examples

Default

Pass an icon name from the registry (or any node) and a required aria-label — the control has no visible text.

Demo.tsxTSX
import { IconButton } from '@var-ui/react';

<IconButton icon="close" aria-label="Close" />

Sizes

Use size (xs / sm / md / lg / xl) with the same tone and appearance props as Button. Like Button, it falls back to the surrounding control size, then md. The glyph follows the size: xl (48px) carries a 24px icon (size.icon.xl). Add pill for a circle, as with a hero play button.

Demo.tsxTSX
import { HStack, IconButton, Stack } from '@var-ui/react';

<Stack gap="lg">
  <HStack gap="sm">
    <IconButton icon="search" aria-label="Search extra small" size="xs" />
    <IconButton icon="search" aria-label="Search small" size="sm" />
    <IconButton icon="search" aria-label="Search medium" size="md" />
    <IconButton icon="search" aria-label="Search large" size="lg" />
    <IconButton icon="search" aria-label="Search extra large" size="xl" />
  </HStack>
  <HStack gap="sm">
    <IconButton icon="close" aria-label="Close" />
    <IconButton icon="search" aria-label="Search" tone="accent" appearance="solid" />
    <IconButton icon="menu" aria-label="Menu" tone="accent" appearance="ghost" />
    <IconButton icon="close" aria-label="Delete" tone="danger" appearance="solid" />
  </HStack>
  <HStack gap="sm">
    <IconButton icon="star" aria-label="Favorite" size="xl" pill tone="accent" appearance="solid" />
  </HStack>
</Stack>

Props

Accessibility

aria-label is required because there is no text content. Built on React Aria Button, so keyboard activation and disabled semantics match Button. Prefer a short action name (“Close”, “Search”) over describing the glyph.