Skip to content

IconButton

IconButton

<IconButton aria-label="Close"><CloseIcon /></IconButton>
<IconButton aria-label="Delete" tone="danger" variant="soft"><TrashIcon /></IconButton>

Install: @helixui/core

import { IconButton } from '@helixui/core'

status: stable · since: 0.1.0

Tags: clickable, icon-only, compact, action

Live playground

Open the full editor or source on GitHub.

Anatomy

[ ⊙ ] ← square button, icon only

Layout

  • displayinline-block
  • widthcontent
  • heightcontent
  • intrinsicSize~28/36/44px square (sm/md/lg)
  • stackabletrue
  • fullBleedfalse

Visual

A square button (radius.md) sized for an icon child. Same variants and tones as Button. Requires aria-label.

Props

NameTypeDefaultDescription
aria-labelstringRequired. Names the action — screen readers have no visible text to read.
variant'solid' | 'soft' | 'ghost' | 'outline'ghostVisual style.
tone'brand' | 'neutral' | 'danger'neutralColor intent.
size'sm' | 'md' | 'lg'mdSquare size — 32 / 40 / 48 px.

Slots

  • children — the icon node

Tokens used

color.bg.action.brand.default, color.bg.action.brand.hover, color.bg.action.brand.subtle, color.bg.action.neutral.default, color.bg.action.neutral.hover, color.bg.action.danger.default, color.bg.action.danger.hover, color.bg.action.danger.subtle, color.bg.surface.default, color.text.primary, color.text.on.brand, color.text.on.danger, color.text.action.brand, color.text.action.danger, color.border.default, color.border.strong, color.border.focus, radius.md

Accessibility

Role: button

Notes

  • aria-label is required. TypeScript enforces it.
  • For destructive icon-only actions, include a Tooltip describing what the action does.

Composes with

ComponentRelationNote
TooltipwrapsWrap with Tooltip to expose what the icon means.
ButtonalternativeUse Button when there is a text label.
ChatHeaderchildCommon in right-aligned actions.

Prompt examples

These are the AI prompt → JSX mappings used by the helixui prompt DSL and integrations like Cursor / Claude Code.

“three-dot icon button with tooltip”

<TooltipTrigger><IconButton aria-label="More"><MoreIcon /></IconButton><Tooltip>More</Tooltip></TooltipTrigger>