Icon
Use the Icon component to place a single glyph anywhere in your text. It pulls
from Lucide, so any icon name on that site works here.
Inline
Icons sit on the text baseline, so they read well inside a sentence. Save your work often and ship when the tests pass .
Sizing
Pass size in pixels. The default is 16.
Color
By default an icon takes the color of the surrounding text. Pass color with any
CSS color to override it.
Usage
<script> import { Icon } from '$lib';</script>Save your work <Icon icon="save" /> often.<Icon icon="flag" size={32} color="oklch(0.62 0.22 25)" />Props
| Prop | Type | Description |
|---|---|---|
icon |
string |
Lucide icon name (required) |
size |
number |
Size in pixels (default 16) |
color |
string |
Any CSS color (defaults to inherit) |