* Allow string values for `size` and `strokeWidth` in icon contexts
The global icon context types declare `size` and `strokeWidth` as `number`,
while the component props they supply defaults for accept `number | string`.
The context value is passed through to the component untouched, so a CSS
length that works on a single icon is rejected when set as a default:
setLucideProps({ size: '1em' }); // Type 'string' is not assignable to 'number'
<Moon size="1em" /> // same value, same code path, no error
* Accept a string `size` on vue icon components
@lucide/vue types the component prop as `size?: 24 | number`, so it rejects the
CSS lengths its own `strokeWidth?: number | string` accepts, and that every other
framework accepts. The value goes straight to the `width`/`height` attributes,
so a string already works at runtime.
* Allow string `size` and `strokeWidth` in the icon context
Copilot's PR comment correctly surfaced a gap in the PR - the same type
bug exists in the lucide-react-native project and wasn't fixed there.
Same narrowing as the other framework contexts: `LucideProps` accepts
`size?: string | number`, and `strokeWidth` resolves to react-native-svg's
`NumberProp` (`string | number`), but the context and `LucideProviderProps`
declared both as `number`. `Icon.ts` passes the context value straight through
— `width: width ?? size ?? contextSize` — so nothing downstream needs a number.
* Don't emit NaN stroke width for non-numeric absolute lengths
`absoluteStrokeWidth` scales the stroke by `Number(size)`, so a CSS unit such
as `1em` produced `NaN` and a size of `0` produced `Infinity` – both invalid as
a `stroke-width` attribute. Fall back to the unscaled stroke width whenever the
conversion isn't finite, so the deprecated prop degrades rather than breaking
the rendered icon.
* fix(packages/angular): allow a string `strokeWidth` in the global config
`LucideConfig` already types `size` as `string | number` but left `strokeWidth`
as `number`, while `LucideIconBase` accepts `string | number` for both and
passes the configured value straight to the shared builder. So
`provideLucideConfig({ strokeWidth: '1em' })` was rejected for no reason.
* refactor(shared): keep absolute stroke scaling inside its branch
The finite-value fallback added in
|
||
|---|---|---|
| .cspell | ||
| .github | ||
| .husky | ||
| .vscode | ||
| .well-known | ||
| categories | ||
| docs | ||
| groups | ||
| icons | ||
| integrations | ||
| lab | ||
| packages | ||
| scripts | ||
| tools | ||
| .editorconfig | ||
| .gitignore | ||
| .npmignore | ||
| .prettierignore | ||
| brand-stopwords.json | ||
| BRAND_LOGOS_STATEMENT.md | ||
| category.schema.json | ||
| CODE_OF_CONDUCT.md | ||
| comment-markup.md | ||
| CONTRIBUTING.md | ||
| cspell.json | ||
| eslint.config.js | ||
| group.schema.json | ||
| icon.schema.json | ||
| LICENSE | ||
| lint-staged.config.mjs | ||
| package.json | ||
| pnpm-lock.yaml | ||
| pnpm-workspace.yaml | ||
| prettier-plugin-lucide-svg.mjs | ||
| prettier.config.mjs | ||
| README.md | ||
| tsconfig.json | ||
Icons · Guide · Packages · License · Showcase
Lucide
Lucide is an open-source icon library that provides 1600+ vector (svg) files for displaying icons and symbols in digital and non-digital projects. The library aims to make it easier for designers and developers to incorporate icons into their projects by providing several official packages to make it easier to use these icons in your project.
Packages
| Logo | Package | Version | Downloads | Links |
|---|---|---|---|---|
lucide |
Docs · Source | |||
lucide-react |
Docs · Source | |||
@lucide/vue |
Docs · Source | |||
@lucide/svelte |
Docs · Source | |||
lucide-solid |
Docs · Source | |||
lucide-preact |
Docs · Source | |||
lucide-react-native |
Docs · Source | |||
@lucide/angular |
Docs · Source | |||
@lucide/astro |
Docs · Source | |||
lucide-static |
Docs · Source |
Figma
The Lucide Figma plugin.
Visit Figma community page to install the plugin.
Contributing
For more info on how to contribute please see the contribution guidelines.
Caught a mistake or want to contribute to the documentation? Edit this page on Github
About brand logos
Lucide does not accept brand logos, and we do not plan to add them in the future. This is due to a combination of legal restrictions, design consistency concerns, and practical maintenance reasons.
Click here to read our official statement about brand logos in Lucide.
Community
Join the community on our Discord server!
License
Lucide is totally free for commercial use and personal use, this software is licensed under the ISC License.
Credits
Thank you to all the people who contributed to Lucide!
Sponsors
Bronze 🥉
Backers 🍺
Supporters ☕️
Other contributors 💸
You can find all our past and non-recurring financial contributors at our Open Collective page.