Skip to main content
  1. Docs
  2. Components
  3. Actions

Icon button

An action shown as an icon. Its name is required, and shows as its tooltip.

Import
@qeetrix/react
Status
StableSince 0.0.2
Renders
<button>Server-rendered
Tested
WCAG 2.2 AAaxe on every pull request

01

Import

icon-button.tsx
// From the package: a build keeps only what it uses.
import { IconButton } from "@qeetrix/react";

// Or from its own path.
import { IconButton } from "@qeetrix/react/button";

02

Props

And every native attribute of the element it renders.

PropTypeDefaultWhat it does
iconIconSourcerequiredThe icon, from @qeetrix/icons, drawn sharp.
aria-labelstringrequiredIts name: announced, and shown as its tooltip.
variant"ghost" | "soft" | "solid""ghost"Emphasis: tertiary, secondary, primary.
tone"brand" | "danger" | "neutral""brand"neutral for utility actions in toolbars and rows.
size"sm" | "md" | "lg""md"A square, at a control's height.
tooltipReactNode | falsearia-labelOther text to show, or false where the name is visible nearby.
tooltipSide"top" | "bottom" | "left" | "right" | "inline-start" | "inline-end""top"The side it opens on; it flips when there's no room.
loadingbooleanfalseA spinner replaces the icon; clicks are ignored; aria-busy is set.
disabledbooleanfalseSets aria-disabled; it stays focusable, and its tooltip still shows.
renderButton.Props["render"]—Renders another element through Base UI, e.g. a router link.

03

Parts

Each part carries a data-slot, for tests and placement.

data-slotElementWhat it is
icon-button<button>The root. data-variant, data-tone, data-size; data-loading when set.
button-icon<svg>The icon.
button-spinner<span>In the icon's place while loading.

04

Beside the value it copies

Where the words are in view, the tooltip would only repeat them.

user-id.tsx
<Inline gap="xs" align="center">
  <Text mono>usr_01J8K2M4PQ</Text>
  <IconButton icon={CopyIcon} aria-label="Copy user ID" tooltip={false} />
</Inline>
Next — Icon buttonAccessibility