elementsicon
Icon
Renders an icon from a UnoCSS icon class, JSX element, or render function.
Import#
Slot Structure#
Icon element with no slot.
Examples#
Icon Sizes#
Numeric pixel sizes from 12 to 48.
Icon Gallery#
Common Lucide icons rendered via UnoCSS classes.
Icon as JSX#
Pass a JSX element or render function instead of a string name.
API Reference#
Props#
| Prop | Type | Default | Description |
|---|---|---|---|
| class | ClassValue | — | Class applied to the component root or trigger element. |
| classes | IconT.Classes | undefined | — | — |
| name | IconT.Name | — | Icon source. Strings should be Uno icon classes such as `i-lucide-search`
or app-config aliases such as `icon-search`.
Non-string values can be JSX nodes or render functions. |
| ref | JSX.HTMLElementTags["div"] extends { ref?: infer Ref; } ? Ref : never | undefined | — | — |
| size | string | number | undefined | — | Icon size. Numbers are interpreted as px. |
| slotName | string | undefined | icon | Data slot for styling. |
| style | JSX.CSSProperties | undefined | — | — |
| styles | IconT.Styles | undefined | — | — |
ARIA#
Accessibility attributes and roles emitted by the component markup.
| Attribute | Type | Default | Description |
|---|---|---|---|
| aria-hidden | boolean | string | undefined | — | Hides decorative content from assistive technology. |
Data Attributes#
State and slot attributes exposed for styling hooks and selectors.
| Attribute | Type | Default | Description |
|---|---|---|---|
| data-slot | string | — | Identifies the rendered slot for styling hooks and selectors. |