Components

IconButton

Icon-only button without a background, with an optional on/off toggle

Overview

IconButton is a button that shows only an icon. Use it where buttons sit side by side, such as a text formatting toolbar or timer controls. Its hover, pressed and on colors belong to the component, so every icon button looks the same.

Because there is no visible text, aria-label is required. It is the name screen readers announce.

Basic

Toggle

Pass aria-pressed to make it an on/off button. When it is true, the button shows the on color and screen readers announce it as pressed.

Disabled

Pass disabled to turn it off. The icon switches to the disabled color, even if you gave the Icon its own color, so a disabled button never looks clickable.

Sizes

  • md: Default. Text formatting toolbar
  • sm: Smaller padding. Timer controls next to a log

Props

PropTypeDefaultRequiredDescription
size'sm' | 'md''md'NoPadding size. sm for timer controls, md for the formatting toolbar
aria-labelstring-YesAccessible name. Required because the button shows only an icon
aria-pressedboolean-NoMakes it a toggle button. true shows the on color
disabledbooleanfalseNoDisabled. No hover or pressed color
type'button' | 'submit' | 'reset''button'NoButton type. Defaults to button, so it does not submit a form
onClickMouseEventHandler<HTMLButtonElement>-NoClick handler
childrenReactNode-YesIcon
classNamestring-NoExtra CSS class
refRef<HTMLButtonElement>-NoRef to the button element

Specification

base

상태요소속성값
enabledrootborderRadius$size.radius.200
enabledrootbackgroundColortransparent토큰 아님 — button without a background
hoverrootbackgroundColor$color.background.default.defaultHover
pressedrootbackgroundColor$color.background.default.defaultPressed
selectedrootbackgroundColor$color.background.default.defaultHover
disablediconcolor$color.icon.disabled.default

size=sm

상태요소속성값
enabledrootpadding$size.space.100

size=md

상태요소속성값
enabledrootpadding$size.space.150

Usage Guidelines

Do

  • Always give aria-label a short action name, such as Start or Bold
  • Use aria-pressed for buttons that stay on, instead of changing the color yourself

Don't

  • Don't build a clickable icon from Box, Inline or Stack. They have no hover, pressed or on styles
  • Don't use IconButton for the main action of a screen. Use Button