Beautiful and consistent icon toolkit
Find a file
Ken Kunz c1a02a04d4
fix(packages): allow string values for size and strokeWidth in global icon config (#4870)
* 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 b65ee945 computed the scaled width before
testing `absoluteStrokeWidth`, so the default path paid for three `Number`
conversions and a division it never used. Start from the unscaled width and
overwrite it only when scaling both applies and yields a finite result, which
also states the rule more directly.

---------

Co-authored-by: Eric Fennis <eric.fennis@gmail.com>
2026-11-20 14:43:11 +01:00
.cspell feat(lab): added floorball icon (#5213) 2026-11-19 17:08:22 +00:00
.github perf(site): cache related icon names and reuse search indexes (#5123) 2026-11-16 15:59:56 +01:00
.husky chore(dependencies): Update dependencies (#4806) 2026-09-04 17:34:58 +02:00
.vscode chore(dev): upgrade ESLint to latest compatible stack (v10) (#4378) 2026-08-18 13:09:22 +02:00
.well-known feat(site): Add sponsor page (#5132) 2026-11-02 12:21:25 +01:00
categories chore(categories): remove seasons category (#5232) 2026-11-16 12:33:52 +01:00
docs feat(site): Preselect external libraries via ?library= URL param (#5180) 2026-11-19 14:47:14 +01:00
groups feat(icons): added bot-check, bot-minus, bot-plus and 1 more icons (#5233) 2026-11-16 17:22:11 +01:00
icons feat(icons): added folder-plus-corner icon (#4408) 2026-11-19 16:06:15 +00:00
integrations chore(deps): bump next from 16.4.1 to 16.4.5 (#5244) 2026-11-19 11:45:08 +00:00
lab feat(lab): added shuttlecock icon (#3707) 2026-11-19 18:12:04 +01:00
packages fix(packages): allow string values for size and strokeWidth in global icon config (#4870) 2026-11-20 14:43:11 +01:00
scripts fix(scripts): Fixes generateNextJSAliases.mts on commit hook (#5167) 2026-11-06 13:25:23 +00:00
tools fix(lucide-react-native): include license banner once instead of in every module (#5194) 2026-11-12 08:20:16 +01:00
.editorconfig Featherity Npm package, reorganize scripting. (#52) 2020-10-06 20:23:26 +02:00
.gitignore chore(angular): stop tracking the ng-packagr build cache (#5202) 2026-11-13 16:04:37 +01:00
.npmignore remove mentions of the site folder in doc and config files (#1769) 2024-01-02 15:14:34 +01:00
.prettierignore feat(ci): auto-generate PR titles from added file paths (#4790) 2026-10-15 17:17:01 +02:00
brand-stopwords.json feat(icons): removed brand names from tags & revised brand stopwords (#4575) 2026-07-23 08:13:10 +02:00
BRAND_LOGOS_STATEMENT.md Fix link to icon design principles in statement (#4225) 2026-03-28 07:48:12 +01:00
category.schema.json chore(categories): Add description field to categories (#4909) 2026-10-07 14:06:24 +02:00
CODE_OF_CONDUCT.md docs(version-1): Version 1 website (#4142) 2026-03-20 17:04:28 +01:00
comment-markup.md ci(pull-request): Fix generate comments for empty changes (#2593) 2024-11-08 16:00:23 +01:00
CONTRIBUTING.md feat(analytics): add utm source and medium (#4596) 2026-07-25 12:26:26 +02:00
cspell.json ci(lint): split lint jobs and annotate Prettier and JSON schema errors in PRs (#4982) 2026-10-09 11:30:00 +02:00
eslint.config.js feat(metadata|docs): reusable tag groups with $group: (#5037) 2026-10-29 17:29:58 +01:00
group.schema.json feat(metadata|docs): reusable tag groups with $group: (#5037) 2026-10-29 17:29:58 +01:00
icon.schema.json chore(categories): remove seasons category (#5232) 2026-11-16 12:33:52 +01:00
LICENSE Update license 2026-03-20 16:30:53 +01:00
lint-staged.config.mjs feat(metadata|docs): reusable tag groups with $group: (#5037) 2026-10-29 17:29:58 +01:00
package.json Update deps (#5228) 2026-11-16 12:34:15 +01:00
pnpm-lock.yaml chore(deps): bump next from 16.4.1 to 16.4.5 (#5244) 2026-11-19 11:45:08 +00:00
pnpm-workspace.yaml chore(deps): Fix security vulnerabilities alerts (#5147) 2026-11-02 20:58:02 +01:00
prettier-plugin-lucide-svg.mjs feat(icons): replaces podcast icon with new mic-* icons (#4583) 2026-07-25 22:58:54 +02:00
prettier.config.mjs feat(metadata|docs): reusable tag groups with $group: (#5037) 2026-10-29 17:29:58 +01:00
README.md feat(site): Add sponsor page (#5132) 2026-11-02 12:21:25 +01:00
tsconfig.json chore(dependencies): Update dependencies (#4806) 2026-09-04 17:34:58 +02:00

Lucide - Beautiful & consistent icon toolkit made by the community. Open-source project and a fork of Feather Icons.

license figma installs build status discord chat

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
JS logo lucide npm NPM Downloads Docs · Source
React logo lucide-react npm NPM Downloads Docs · Source
Vue logo @lucide/vue npm NPM Downloads Docs · Source
Svelte logo @lucide/svelte npm NPM Downloads Docs · Source
Solid logo lucide-solid npm NPM Downloads Docs · Source
Preact logo lucide-preact npm NPM Downloads Docs · Source
React Native logo lucide-react-native npm NPM Downloads Docs · Source
Angular logo @lucide/angular npm NPM Downloads Docs · Source
Astro logo @lucide/astro npm NPM Downloads Docs · Source
SVG logo lucide-static npm NPM Downloads Docs · Source

Figma

The Lucide Figma plugin.

Visit Figma community page to install the plugin.

Figma Lucide Cover

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

Powered by Vercel

Bronze 🥉

Sourcegraph – Understand, fix, and automate across your codebase with Sourcegraph's code intelligence platform    Zephyr Cloud

Backers 🍺

Pax Historia    pdfme – Free and Open source PDF generation library!

Supporters ☕️

Fina Money – Build the most flexible finance tracker    Ruud

Other contributors 💸

You can find all our past and non-recurring financial contributors at our Open Collective page.