Icon
The Icon component renders the Lucide icon set with Aidos sizing and semantic colors. IconType is generated from Lucide, so every supported name is available through TypeScript autocomplete.
Props
| Prop | Type | Required | Description |
|---|---|---|---|
| icon | IconType | Yes | The icon identifier (e.g., "check", "github") |
| size | Size | Yes | Icon size: "xsmall" (8px), "small" (12px), "medium" (18px), "large" (24px), "xlarge" (32px), "xxlarge" (48px), "xxxlarge" (64px) |
| color | TextColor | Yes | Icon color, including "inherit" for contextual foreground color |
| ariaLabel | string | No | Accessible label for screen readers |
Sizes
Icons come in seven predefined sizes to maintain consistency across your application.
<Icon icon="star" color="primary" size="xsmall" /> // 8px
<Icon icon="star" color="primary" size="small" /> // 12px
<Icon icon="star" color="primary" size="medium" /> // 18px
<Icon icon="star" color="primary" size="large" /> // 24px
<Icon icon="star" color="primary" size="xlarge" /> // 32px
<Icon icon="star" color="primary" size="xxlarge" /> // 48px
<Icon icon="star" color="primary" size="xxxlarge" /> // 64px
Colors
Icons inherit semantic colors from the theme system, ensuring they adapt correctly to light and dark modes.
<Icon icon="heart" color="primary" size="large" /> // Main content color
<Icon icon="heart" color="secondary" size="large" /> // Secondary content
<Icon icon="heart" color="highlight" size="large" /> // Accent/brand color
<Icon icon="heart" color="negative" size="large" /> // Error/destructive
<Icon icon="heart" color="subtle" size="large" /> // Muted/disabled
<Icon icon="heart" color="light" size="large" /> // Light/inverted
Icon examples
A selection of commonly used icons:
// Action icons
<Icon icon="check" color="primary" size="medium" />
<Icon icon="x" color="negative" size="medium" />
<Icon icon="search" color="secondary" size="medium" />
// Social icons
<Icon icon="github" color="primary" size="medium" />
<Icon icon="twitter" color="primary" size="medium" />
Accessibility
Always provide an ariaLabel when the icon conveys meaning that isn't available through surrounding text.
// Decorative icon (no label needed if text explains it)
<Button>
<Icon icon="download" color="light" size="small" />
Download
</Button>
// Meaningful icon (needs label for screen readers)
<Icon
icon="triangle-alert"
color="negative"
size="medium"
ariaLabel="Warning"
/>
Loading icons
Icons load lazily from chunks bundled with your application, not from a CDN. Keep those chunks alongside the application build when deploying or packaging it.
Preload common icons in your application entry point; less common icons can stay lazy:
import "aidos-ui/icons/search";
import "aidos-ui/icons/check";
Or preload the entire catalog:
import "aidos-ui/icons";
- No registration call or startup promise is needed.
- Individual imports preload only the named icon (and its canonical parent for aliases), not its lazy bucket.
- The full lazy catalog still ships with your application so unimported icons remain available.
- Eager icons render immediately, including in server HTML. Use identical preload imports on the server and in the browser so hydration preserves those SVGs.
- Lazy icons retain their sized placeholder during SSR and hydration, regardless of cache warmth, then appear when loaded.
- Existing Lucide names and aliases remain supported.
Replace previous Iconify addIcon / addCollection preload code with the eager import. Iconify's cache no longer controls Aidos icons.
Finding icons
Browse the Lucide icon directory and pass its kebab-case name directly, such as search, circle-alert, or panel-left. Aidos intentionally does not support alternate icon sets, provider overrides, or arbitrary Iconify names.