Skip to the content

IconText

IconText is an inert glyph-and-copy pair: an icon beside a line of text, aligned and spaced by tokens. It has no state and no interaction. Typography and color props set on the pair apply to both parts.
Typography & Media

When to use

Use when
  • Metadata rows, feature lists, empty-state lines or menu rows carry a glyph.
  • You build an icon bullet list (as="li").
Avoid when
  • The pair triggers something — use Button or Link.
  • It announces a status — use Label.
  • It is a heading — use Text with an inline Icon.

Usage

Updated 2 min ago
Two-factor enabled
Settings
<IconText icon={<Icon icon={clock} />} text="Updated 2 min ago" color="ink.secondary" fontSize="micro" />
<IconText icon={<Icon icon={check} />} text="Two-factor enabled" color="success" />
<IconText icon={<Icon icon={cog} />} iconPosition="right" text="Settings" />

The icon follows currentColor and 1em, so color and fontSize on the pair size and paint both parts. Give the Icon its own color when only the glyph should differ. The pair renders a span with gap="xs" by default.

Alignment

align="center" (default) suits single-line rows. Use align="baseline" when the copy may wrap or the icon and text sizes differ.

Baseline-aligned headline

Lists

  • Feature one
  • Feature two
<Flex as="ul" gap="micro">
  <IconText as="li" icon={<Icon icon={check} color="success" />} text="Feature one" />
</Flex>

Accessibility

  • The copy carries the meaning; mark a purely decorative glyph with aria-hidden="true" on the Icon.
  • When the icon changes the meaning (a check for "done"), say it in the copy, not only in the glyph or its color.

Properties

See also