Rost
← All components
component

IconButton

A round button with only an icon, including a Project type for sitting on top of images.

In codeContract: reviewGuidance: agreedContract on GitHubFigma 93:587
Primary · Default
Primary · Disabled
Secondary · Default
Secondary · Disabled
Tertiary · Default
Tertiary · Disabled
Project · Default
Project · Disabled

Hover, press or tab to one to see the other 12 states.

When to use

  • Actions everyone knows where a label would crowd things: close, back, next, previous.
  • Project on top of imagery: thumbnails and cards.

When not to use

  • Any icon that isn't instantly obvious. Use Button with a label, an icon isn't one.
  • On/off or one-of-many choices. That's Toggle. IconButton does something, it doesn't remember anything.

Behaviour

type is Primary, Secondary, Tertiary or Project. States come from the browser like every other action. Don't shrink it below 40px, fingers need the room.

Accessibility

  • Element: <button type="button">.
  • Name: aria-label is a must, there's no visible text. Say what it does ("Close dialog"), not what it shows ("X").
  • Keyboard: Enter and Space.
  • Focus: focus-ring, on :focus-visible.
  • Tooltip: give it a tooltip with the same words, once there's a Tooltip in the kit.

Content

No text. The aria-label follows the same rules as Button.

Props

PropTypeValuesDefault
typeenumPrimary · Project · Secondary · TertiaryPrimary

States: Default, Hover, Pressed, Focus, Disabled.

Where it's used

Values

Straight from the contract. Each value sits next to its token, because six tokens here all come out as #3a3a3a and the colour alone can't tell you which one is right.

Never changes

PartPropertyValueToken
rootjustify-contentcenterlayout
rootalign-itemscenterlayout
rootdisplayinline-flexlayout
rootvertical-alignmiddlelayout
rootpositionrelativelayout
rootbackgroundnoneFigma frame size
rootbordernoneFigma frame size
rootcursorpointerFigma frame size
rootoutlinenoneFigma frame size
rootgap8pxspacing/gap/small
rootborder-radius10000pxspacing/radius/full
icons-arrow-leftoverflowcliplayout
icons-arrow-leftflex-shrink0layout
icons-arrow-leftpositionrelativelayout
icons-arrow-leftwidth20pxspacing/size/xsmall
icons-arrow-leftheight20pxspacing/size/xsmall
glyphdisplayblocklayout
glyphwidth100%layout
glyphheight100%layout
glyphbackgroundcurrentColorno token yet
glyphmaskurl(./icon-arrow-left.svg) center / contain no-repeaton purpose: The icon file itself. `assets/icons/arrow-left.svg`, the same shape Figma uses (its insets match Figma's `Union` layer exactly).
backgroundpositionabsolutelayout
backgroundinset0layout
backgroundpointer-eventsnoneFigma frame size
focus-ringdisplaynonelayout
focus-ringborder-stylesolidno token yet
focus-ringpointer-eventsnoneFigma frame size

Changes by variant

background.background9
type=Secondary, state=Default#3a3a3aactions/secondary/regular/default/background
type=Secondary, state=Hover#747573actions/secondary/regular/hover/background
type=Tertiary, state=Hover#060805actions/tertiary/hover/background
type=Secondary, state=Pressed#999actions/secondary/regular/pressed/background
type=Tertiary, state=Pressed#454545actions/tertiary/pressed/background
type=Secondary, state=Disabled#3a3a3aactions/secondary/regular/disabled/background
type=Secondary, state=Focus#3a3a3aactions/secondary/regular/focus/background
type=Project, state=Hover#060805actions/tertiary/hover/background
type=Project, state=Pressed#454545actions/tertiary/pressed/background
background.border-color5
type=Secondary, state=Default#edededactions/secondary/regular/default/outline
type=Secondary, state=Hover#edededactions/secondary/regular/hover/outline
type=Secondary, state=Pressed#edededactions/secondary/regular/pressed/outline
type=Secondary, state=Disabled#edededactions/secondary/regular/disabled/outline
type=Secondary, state=Focus#edededactions/secondary/regular/focus/outline
background.border-radius9
type=Secondary, state=Default10000pxspacing/radius/full
type=Secondary, state=Hover10000pxspacing/radius/full
type=Tertiary, state=Hover10000pxspacing/radius/full
type=Secondary, state=Pressed10000pxspacing/radius/full
type=Tertiary, state=Pressed10000pxspacing/radius/full
type=Secondary, state=Disabled10000pxspacing/radius/full
type=Secondary, state=Focus10000pxspacing/radius/full
type=Project, state=Hover10000pxspacing/radius/full
type=Project, state=Pressed10000pxspacing/radius/full
background.border-sides5
type=Secondary, state=Defaultleft toplayout
type=Secondary, state=Hoverleft toplayout
type=Secondary, state=Pressedleft toplayout
type=Secondary, state=Disabledleft toplayout
type=Secondary, state=Focusleft toplayout
background.inset9
type=Secondary, state=Default0layout
type=Secondary, state=Hover0layout
type=Tertiary, state=Hover0layout
type=Secondary, state=Pressed0layout
type=Tertiary, state=Pressed0layout
type=Secondary, state=Disabled0layout
type=Secondary, state=Focus0layout
type=Project, state=Hover0layout
type=Project, state=Pressed0layout
background.opacity9
type=Secondary, state=Default0.24opacity/gentle
type=Secondary, state=Hover0.32opacity/mild
type=Tertiary, state=Hover0.32opacity/mild
type=Secondary, state=Pressed0.32opacity/mild
type=Tertiary, state=Pressed0.32opacity/mild
type=Secondary, state=Disabled0.32opacity/mild
type=Secondary, state=Focus0.24opacity/gentle
type=Project, state=Hover0.32opacity/mild
type=Project, state=Pressed0.32opacity/mild
background.position9
type=Secondary, state=Defaultabsolutelayout
type=Secondary, state=Hoverabsolutelayout
type=Tertiary, state=Hoverabsolutelayout
type=Secondary, state=Pressedabsolutelayout
type=Tertiary, state=Pressedabsolutelayout
type=Secondary, state=Disabledabsolutelayout
type=Secondary, state=Focusabsolutelayout
type=Project, state=Hoverabsolutelayout
type=Project, state=Pressedabsolutelayout
focus-ring.border-color4
type=Primary, state=Focus#b6ffdaactions/primary/focus/focus-ring
type=Secondary, state=Focus#999actions/secondary/regular/focus/focus-ring
type=Tertiary, state=Focus#999actions/secondary/regular/focus/focus-ring
type=Project, state=Focus#999actions/secondary/regular/focus/focus-ring
focus-ring.border-radius4
type=Primary, state=Focus10000pxspacing/radius/full
type=Secondary, state=Focus10000pxspacing/radius/full
type=Tertiary, state=Focus10000pxspacing/radius/full
type=Project, state=Focus10000pxspacing/radius/full
focus-ring.border-sides4
type=Primary, state=Focusalllayout
type=Secondary, state=Focusalllayout
type=Tertiary, state=Focusalllayout
type=Project, state=Focusalllayout
focus-ring.border-width4
type=Primary, state=Focus2pxspacing/outline/medium
type=Secondary, state=Focus2pxspacing/outline/medium
type=Tertiary, state=Focus2pxspacing/outline/medium
type=Project, state=Focus2pxspacing/outline/medium
focus-ring.display4
type=Primary, state=Focusblocklayout
type=Secondary, state=Focusblocklayout
type=Tertiary, state=Focusblocklayout
type=Project, state=Focusblocklayout
focus-ring.inset4
type=Primary, state=Focuscalc(-1 * var(--spacing-gap-2xsmall))layout
type=Secondary, state=Focuscalc(-1 * var(--spacing-gap-2xsmall))layout
type=Tertiary, state=Focuscalc(-1 * var(--spacing-gap-2xsmall))layout
type=Project, state=Focuscalc(-1 * var(--spacing-gap-2xsmall))layout
focus-ring.position4
type=Primary, state=Focusabsolutelayout
type=Secondary, state=Focusabsolutelayout
type=Tertiary, state=Focusabsolutelayout
type=Project, state=Focusabsolutelayout
icons-arrow-left.color20
type=Primary, state=Default#3a3a3aactions/primary/default/icon
type=Secondary, state=Default#00d669actions/secondary/regular/default/icon
type=Tertiary, state=Default#00d669actions/tertiary/default/icon
type=Primary, state=Hover#3a3a3aactions/primary/hover/icon
type=Secondary, state=Hover#00b450actions/secondary/regular/hover/icon
type=Tertiary, state=Hover#00b450actions/tertiary/hover/icon
type=Primary, state=Pressed#3a3a3aactions/primary/pressed/icon
type=Secondary, state=Pressed#00d669actions/secondary/regular/pressed/icon
type=Tertiary, state=Pressed#00d669actions/tertiary/pressed/icon
type=Primary, state=Disabled#3a3a3aactions/primary/disabled/icon
type=Secondary, state=Disabled#00d669actions/secondary/regular/disabled/icon
type=Tertiary, state=Disabled#00d669actions/tertiary/disabled/icon
type=Primary, state=Focus#3a3a3aactions/primary/focus/icon
type=Secondary, state=Focus#00d669actions/secondary/regular/focus/icon
type=Tertiary, state=Focus#00d669actions/tertiary/focus/icon
type=Project, state=Default#00d669actions/borderless/default/icon
type=Project, state=Hover#00b450actions/borderless/hover/icon
type=Project, state=Pressed#00d669actions/borderless/pressed/icon
type=Project, state=Disabled#00d669actions/borderless/disabled/icon
type=Project, state=Focus#00d669actions/borderless/focus/icon
icons-arrow-left.height5
type=Project, state=Default16pxspacing/size/2xsmall
type=Project, state=Hover16pxspacing/size/2xsmall
type=Project, state=Pressed16pxspacing/size/2xsmall
type=Project, state=Disabled16pxspacing/size/2xsmall
type=Project, state=Focus16pxspacing/size/2xsmall
icons-arrow-left.width5
type=Project, state=Default16pxspacing/size/2xsmall
type=Project, state=Hover16pxspacing/size/2xsmall
type=Project, state=Pressed16pxspacing/size/2xsmall
type=Project, state=Disabled16pxspacing/size/2xsmall
type=Project, state=Focus16pxspacing/size/2xsmall
root.background5
type=Primary, state=Default#00d669actions/primary/default/background
type=Primary, state=Hover#00b450actions/primary/hover/background
type=Primary, state=Pressed#00913aactions/primary/pressed/background
type=Primary, state=Disabled#00d669actions/primary/disabled/background
type=Primary, state=Focus#00d669actions/primary/focus/background
root.box-shadow5
type=Primary, state=Defaultinset var(--spacing-outline-small) var(--spacing-outline-small) 0 0 var(--actions-primary-default-outline)on purpose: Figma's 1px left and top stroke, drawn inside the shape as Figma draws it. The width and colour are tokens.
type=Primary, state=Hoverinset var(--spacing-outline-small) var(--spacing-outline-small) 0 0 var(--actions-primary-hover-outline)on purpose: Figma's 1px left and top stroke, drawn inside the shape as Figma draws it. The width and colour are tokens.
type=Primary, state=Pressedinset var(--spacing-outline-small) var(--spacing-outline-small) 0 0 var(--actions-primary-pressed-outline)on purpose: Figma's 1px left and top stroke, drawn inside the shape as Figma draws it. The width and colour are tokens.
type=Primary, state=Disabledinset var(--spacing-outline-small) var(--spacing-outline-small) 0 0 var(--actions-primary-disabled-outline)on purpose: Figma's 1px left and top stroke, drawn inside the shape as Figma draws it. The width and colour are tokens.
type=Primary, state=Focusinset var(--spacing-outline-small) var(--spacing-outline-small) 0 0 var(--actions-primary-focus-outline)on purpose: Figma's 1px left and top stroke, drawn inside the shape as Figma draws it. The width and colour are tokens.
root.cursor4
type=Primary, state=DisableddefaultFigma frame size
type=Secondary, state=DisableddefaultFigma frame size
type=Tertiary, state=DisableddefaultFigma frame size
type=Project, state=DisableddefaultFigma frame size
root.height20
type=Primary, state=Default48pxspacing/size/medium-large
type=Secondary, state=Default48pxspacing/size/medium-large
type=Tertiary, state=Default48pxspacing/size/medium-large
type=Primary, state=Hover48pxspacing/size/medium-large
type=Secondary, state=Hover48pxspacing/size/medium-large
type=Tertiary, state=Hover48pxspacing/size/medium-large
type=Primary, state=Pressed48pxspacing/size/medium-large
type=Secondary, state=Pressed48pxspacing/size/medium-large
type=Tertiary, state=Pressed48pxspacing/size/medium-large
type=Primary, state=Disabled48pxspacing/size/medium-large
type=Secondary, state=Disabled48pxspacing/size/medium-large
type=Tertiary, state=Disabled48pxspacing/size/medium-large
type=Primary, state=Focus48pxspacing/size/medium-large
type=Secondary, state=Focus48pxspacing/size/medium-large
type=Tertiary, state=Focus48pxspacing/size/medium-large
type=Project, state=Default32pxspacing/size/small-medium
type=Project, state=Hover32pxspacing/size/small-medium
type=Project, state=Pressed32pxspacing/size/small-medium
type=Project, state=Disabled32pxspacing/size/small-medium
type=Project, state=Focus32pxspacing/size/small-medium
root.opacity4
type=Primary, state=Disabled0.24opacity/gentle
type=Secondary, state=Disabled0.24opacity/gentle
type=Tertiary, state=Disabled0.24opacity/gentle
type=Project, state=Disabled0.24opacity/gentle
root.padding5
type=Project, state=Default0pxspacing/gap/none
type=Project, state=Hover0pxspacing/gap/none
type=Project, state=Pressed0pxspacing/gap/none
type=Project, state=Disabled0pxspacing/gap/none
type=Project, state=Focus0pxspacing/gap/none
root.padding-bottom15
type=Primary, state=Default0pxspacing/gap/none
type=Secondary, state=Default0pxspacing/gap/none
type=Tertiary, state=Default0pxspacing/gap/none
type=Primary, state=Hover0pxspacing/gap/none
type=Secondary, state=Hover0pxspacing/gap/none
type=Tertiary, state=Hover0pxspacing/gap/none
type=Primary, state=Pressed0pxspacing/gap/none
type=Secondary, state=Pressed0pxspacing/gap/none
type=Tertiary, state=Pressed0pxspacing/gap/none
type=Primary, state=Disabled0pxspacing/gap/none
type=Secondary, state=Disabled0pxspacing/gap/none
type=Tertiary, state=Disabled0pxspacing/gap/none
type=Primary, state=Focus0pxspacing/gap/none
type=Secondary, state=Focus0pxspacing/gap/none
type=Tertiary, state=Focus0pxspacing/gap/none
root.padding-left15
type=Primary, state=Default20pxspacing/gap/medium-large
type=Secondary, state=Default20pxspacing/gap/medium-large
type=Tertiary, state=Default20pxspacing/gap/medium-large
type=Primary, state=Hover20pxspacing/gap/medium-large
type=Secondary, state=Hover20pxspacing/gap/medium-large
type=Tertiary, state=Hover20pxspacing/gap/medium-large
type=Primary, state=Pressed20pxspacing/gap/medium-large
type=Secondary, state=Pressed20pxspacing/gap/medium-large
type=Tertiary, state=Pressed20pxspacing/gap/medium-large
type=Primary, state=Disabled20pxspacing/gap/medium-large
type=Secondary, state=Disabled20pxspacing/gap/medium-large
type=Tertiary, state=Disabled20pxspacing/gap/medium-large
type=Primary, state=Focus20pxspacing/gap/medium-large
type=Secondary, state=Focus20pxspacing/gap/medium-large
type=Tertiary, state=Focus20pxspacing/gap/medium-large
root.padding-right15
type=Primary, state=Default20pxspacing/gap/medium-large
type=Secondary, state=Default20pxspacing/gap/medium-large
type=Tertiary, state=Default20pxspacing/gap/medium-large
type=Primary, state=Hover20pxspacing/gap/medium-large
type=Secondary, state=Hover20pxspacing/gap/medium-large
type=Tertiary, state=Hover20pxspacing/gap/medium-large
type=Primary, state=Pressed20pxspacing/gap/medium-large
type=Secondary, state=Pressed20pxspacing/gap/medium-large
type=Tertiary, state=Pressed20pxspacing/gap/medium-large
type=Primary, state=Disabled20pxspacing/gap/medium-large
type=Secondary, state=Disabled20pxspacing/gap/medium-large
type=Tertiary, state=Disabled20pxspacing/gap/medium-large
type=Primary, state=Focus20pxspacing/gap/medium-large
type=Secondary, state=Focus20pxspacing/gap/medium-large
type=Tertiary, state=Focus20pxspacing/gap/medium-large
root.padding-top15
type=Primary, state=Default0pxspacing/gap/none
type=Secondary, state=Default0pxspacing/gap/none
type=Tertiary, state=Default0pxspacing/gap/none
type=Primary, state=Hover0pxspacing/gap/none
type=Secondary, state=Hover0pxspacing/gap/none
type=Tertiary, state=Hover0pxspacing/gap/none
type=Primary, state=Pressed0pxspacing/gap/none
type=Secondary, state=Pressed0pxspacing/gap/none
type=Tertiary, state=Pressed0pxspacing/gap/none
type=Primary, state=Disabled0pxspacing/gap/none
type=Secondary, state=Disabled0pxspacing/gap/none
type=Tertiary, state=Disabled0pxspacing/gap/none
type=Primary, state=Focus0pxspacing/gap/none
type=Secondary, state=Focus0pxspacing/gap/none
type=Tertiary, state=Focus0pxspacing/gap/none
root.width20
type=Primary, state=Default48pxspacing/size/medium-large
type=Secondary, state=Default48pxspacing/size/medium-large
type=Tertiary, state=Default48pxspacing/size/medium-large
type=Primary, state=Hover48pxspacing/size/medium-large
type=Secondary, state=Hover48pxspacing/size/medium-large
type=Tertiary, state=Hover48pxspacing/size/medium-large
type=Primary, state=Pressed48pxspacing/size/medium-large
type=Secondary, state=Pressed48pxspacing/size/medium-large
type=Tertiary, state=Pressed48pxspacing/size/medium-large
type=Primary, state=Disabled48pxspacing/size/medium-large
type=Secondary, state=Disabled48pxspacing/size/medium-large
type=Tertiary, state=Disabled48pxspacing/size/medium-large
type=Primary, state=Focus48pxspacing/size/medium-large
type=Secondary, state=Focus48pxspacing/size/medium-large
type=Tertiary, state=Focus48pxspacing/size/medium-large
type=Project, state=Default32pxspacing/size/small-medium
type=Project, state=Hover32pxspacing/size/small-medium
type=Project, state=Pressed32pxspacing/size/small-medium
type=Project, state=Disabled32pxspacing/size/small-medium
type=Project, state=Focus32pxspacing/size/small-medium