It intentionally ships **no real rendering logic or components** — but you can use this package to build third-party integrations for frameworks we don't (yet) support.
| `size` or `width` & `height` | `number` | The dimensions of the icon (`size` is shorthand for square icons). |
## How to use
Icons can be imported individually. Only the icons you import end up referenced by your application code — the rest will be eliminated by tree-shaking.
```ts
import { House } from '@lucide/icons';
// House is icon data (not a rendered component).
```
## Building icons
`@lucide/icons` ships small helpers that convert Lucide icon data into different render-ready outputs.
All builders accept the same `params` object (`LucideBuildParams`) to customize the generated SVG.
### Build parameters
The following parameters are supported (names reflect the current implementation):
SVG attributes generated by the builders include a default Lucide setup (`xmlns`, `viewBox`, `fill="none"`, `stroke="currentColor"`, `stroke-width="2"`, `stroke-linecap="round"`, `stroke-linejoin="round"`), plus a class string of the form: `lucide lucide-{iconName}`.
:::
### `buildLucideIconNode`
Creates a root SVG node in an svgson-like format:
```ts
import { buildLucideIconNode } from '@lucide/icons/builders';
import { House } from '@lucide/icons';
const node = buildLucideIconNode(House, {
size: 32,
strokeWidth: 1.5,
className: 'my-icon',
});
// -> ['svg', attributes, children]
```
This is useful if you want to plug Lucide icons into your own renderer, templating system, or framework integration.
### `buildLucideSvg`
Creates an SVG string:
```ts
import { buildLucideSvg } from '@lucide/icons/builders';
Dynamic imports are useful when you only know the icon name at runtime (for example, icon names stored in a database or a CMS). For purely static use cases, prefer direct imports for the best tree-shaking results.
::: tip
Validate `iconName` before indexing the map (and provide a fallback icon) to avoid runtime errors.
Dynamic imports are useful when the icon name is only known at runtime (for example, icon names stored in a CMS or database). For purely static usage, prefer direct imports for maximum tree-shaking.
```ts
import { lucideDynamicIconImports } from '@lucide/icons/dynamic';