@fluid-ds/icons
v0.0.3-alpha.0
Published
Icon registry for Fluid. Curated lucide subset registered by default, ~1500 more available as side-effect modules or via the lazy loadIcon() API.
Downloads
460
Maintainers
Readme
@fluid-ds/icons
Icon registry for Fluid. Curated
lucide subset registered by default (~50 icons),
~1500 more available as per-icon side-effect modules or via the lazy
loadIcon() API.
<fluid-icon name="rocket"></fluid-icon>Install
pnpm add @fluid-ds/iconsUse
Default icon set
import "@fluid-ds/icons/register-defaults";Registers ~50 commonly-needed icons: chevrons, x, check, search, copy, download, eye / eye-off, undo, plus, minus, alerts, common nouns (user, settings, house, bell, …).
Add more on demand
import "@fluid-ds/icons/lucide/rocket"; // side-effect import
import "@fluid-ds/icons/lucide/zap";Or lazy-register at runtime:
import { loadIcon } from "@fluid-ds/icons";
await loadIcon("rocket");
// <fluid-icon name="rocket"> now worksCustom SVG
import { registerIcon } from "@fluid-ds/icons";
registerIcon(
"my-custom",
`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">...</svg>`
);API
| Function | Purpose |
| --- | --- |
| registerIcon(name, svg) | Register a single icon |
| registerIcons({name: svg, …}) | Batch-register |
| getIcon(name) | Read the SVG string |
| hasIcon(name) | Test for presence |
| listIcons() | All registered names |
| loadIcon(name) | Lazy-load from the bundled lucide set |
| onIconRegistered(fn) | Subscribe to registration events |
License
MIT, © Fluid contributors. Icons by lucide under the ISC license.
