Skip to content
SENVENLI UI

Icon

Draws any Lucide icon by name, sized and colored with theme tokens.
Beside text
import { Icon } from "@senvenli/react/display";

Examples

Sizes

Small at 12px, default at 16px and large at 20px.

Semantic colors

Only when the icon carries that meaning, and always with the word.

Standing alone

Without text beside it, `label` gives the icon its accessible name.

Guidelines

When to use it

  • A symbol helps people scan or recognize an action, status or object.
  • An icon-only control needs a picture; give it a label.

Use something else when

  • The status needs a word, not only a symbol. Badge

Do and avoid

  • Pair icons with text unless the meaning is universal; give a standalone icon a label.
  • Use the semantic colors (danger, success…) only when the icon carries that meaning.

Accessibility

Built in

  • Decorative (hidden from assistive technology) when it has no label.
  • Exposed as an image named by label when it has one.
  • Directional icons mirror on right-to-left pages.

You provide

  • A label when the icon carries meaning on its own.

API reference

Icon

nameRequired
IconName

Any Lucide name, kebab-case ("house", "search", "calendar-range").

size
IconSize

small 12px, default 16px, large 20px (ds-size-icon-*).

color
IconColor

inherit (default) takes the text colour around it; the others are the ds-icon-* tokens.

label
string

The accessible name for an icon that carries meaning on its own. Without it the icon is decorative and hidden from assistive technology, which is right when text next to it already says the same thing.

isDirectional
boolean

Mirrors the icon on an RTL page. Left out, the names in DIRECTIONAL_ICONS (arrows and chevrons that point along the reading direction, undo/redo, send, sign in/out) mirror and every other icon stays as drawn. true mirrors any icon; false keeps a directional one as drawn (a compass arrow, a "swipe left" hint).