Components

Icon

SVG icon component with theme color and size token support

Overview

A component that renders SVG icons. Supports theme color tokens and size tokens.

Sizes

SizeValueUse Case
extraSmall12pxInline icons, inside tags
small16pxSmall buttons, inside input fields
medium20pxDefault icon size
large24pxNavigation, header icons

Colors

Icon colors use semantic color tokens:

  • iconDefaultDefault — Default icon
  • iconDefaultDisabled — Disabled icon
  • iconDangerDefault — Danger/error icon
  • iconBrandDefault — Brand icon
  • iconBrandOnBrand — Icon on brand background

Props

PropTypeDefaultRequiredDescription
size'extraSmall' | 'small' | 'medium' | 'large''medium'No12, 16, 20 or 24 px
nameIconName-YesIcon to draw
colorIconColorToken | TextColorToken'iconDefaultDefault'NoIcon color token
rotatenumber-NoRotation in degrees. Changes animate
aria-hiddenboolean | 'true' | 'false'-NoHide from screen readers when the text next to it already says the same thing

Usage

By default an icon is announced by its name (role="img", aria-label = name). Pass aria-hidden="true" when nearby text or the button's own label already says the same thing, so screen readers do not read it twice.

Specification

base

상태요소속성값
enabledrootcolor$color.icon.default.default

size=extraSmall

상태요소속성값
enabledrootwidth$size.icon.extraSmall
enabledrootheight$size.icon.extraSmall

size=small

상태요소속성값
enabledrootwidth$size.icon.small
enabledrootheight$size.icon.small

size=medium

상태요소속성값
enabledrootwidth$size.icon.medium
enabledrootheight$size.icon.medium

size=large

상태요소속성값
enabledrootwidth$size.icon.large
enabledrootheight$size.icon.large