* docs(lucide-react): small changes for DynamicIcon
Changed the sentence structure slightly for DynamicIcon to be easier to understand.
* Update lucide-react.md
* Add gpt tags
* Add github actions flow
* Add link so people can use the chat
* Fix workflow
* Add openai dep
* Add actions core
* Try gh pr review in actions
* Try with octokit
* Remove changed files part
* Try with createReview function
* Try this
* fix broken json file
* Turn on review by gh action
* Try this
* Update icons/trash.json
* Update the runner
* Remove added tags
* Add more checks
* Added icons/tool-case.svg
* Added icons/tool-case.json
* Update tool-case.svg
slightly alter the icon SVG code to match with the "archive" icon
* Update tool-case.svg
* Optimized version of tool-case.svg
* Update icons/tool-case.json
Co-authored-by: Jakob Guddas <github@jguddas.de>
* Update tool-case.svg
---------
Co-authored-by: Eric Fennis <eric.fennis@gmail.com>
Co-authored-by: Jakob Guddas <github@jguddas.de>
* Update base `clock`-icons
Replace `<polyline/>`s with `<path/>`s, and adjust the angles of the 2-, 4-, 8- and 10 o'clock hour hands to better match the 1-, 5-, 7- and 11 o'clock hands
* Update clocks with symbols
Update `clock-arrow-down`, `clock-arrow-up` and `clock-alert` to match the hand angle of `clock`
Also align the exclamation mark of `clock-alert` to the pixel grid
* Update small clock faces
Make the clock faces in `calendar-clock`, `file-clock`, `folder-clock` and `watch` consistent with each other, and resolve some two-pixel-gap violations.
* Align the tips of all hours hands on large clocks to the grid
* Add self-attribution where appropriate
---------
Co-authored-by: Eric Fennis <eric.fennis@gmail.com>
* Added icons/wavy-line.svg
* Added icons/wavy-line.json
* Updated icons/wavy-line.json
* Updated icons/wavy-line.json
* Rename wavy-line.json to line-curvy.json
* Rename wavy-line.svg to line-curvy.svg
* Rename line-curvy.json to line-swirly.json
* Rename line-curvy.svg to line-swirly.svg
* Rename line-swirly.json to line-squiggle.json
* Rename line-swirly.svg to line-squiggle.svg
* Align the icon in the center
* Update icon visually
* Circle the loop of the icon
* Add contributor
* Add `"annotate"` as tag
After seeing Google Chromebook the same icon, it says 'annotate'. I add it here as a tag.
* Update line-squiggle.json
* Update line-squiggle.json
---------
Co-authored-by: Eric Fennis <eric.fennis@gmail.com>
Reordered SVG paths so the shaft renders after the arrowhead, eliminating visual gaps due to stroke rendering.
Co-authored-by: Eric Fennis <eric.fennis@gmail.com>
- Reduce initial icon render from 1600 to 120-200 icons
- Implement dynamic initialGridItems calculation based on viewport
- Use slice() instead of splice() to avoid array mutation
- Fix NoResults condition to use searchResults.length
- Load time improved from (50-60%+ improvement)
- Fix Switch component to properly handle v-model binding
- Add absoluteStrokeWidth to customizingActive computed property
- Ensure absoluteStrokeWidth resets correctly in both Home and Sidebar customizers
Resolves issue where absoluteStrokeWidth toggle remained enabled
after clicking Reset button, causing confusion with bold icons.
Fixes#2984
Co-authored-by: Eric Fennis <eric.fennis@gmail.com>
* Optimised `phone-` icons
* fix(site): remove studio link from navbar (#3166)
* Redraw handset to better align arcs still, and replace some with straight lines
* Align ring lines
---------
Co-authored-by: Jakob Guddas <github@jguddas.de>
* Changed resetStyle to reflect changes of button on absolutestrokewidth
* removed nextTick
---------
Co-authored-by: Eric Fennis <eric.fennis@gmail.com>
* add columns-cog icon and metadata
* chore: rename columns-cog to columns-3-cog as per maintainer request
* added contributors from the icon this is based on
* Remove not existing category
---------
Co-authored-by: Eric Fennis <eric.fennis@gmail.com>
* add electric truck icon
* update json file
* small change to svg
* update icon with zap in the middle
* move icon one pixel down to align with original truck icon
* use new truck as reference
* Update truck-electric.svg
* Update truck-electric.json
* Update truck-electric.svg
* Add contributor AnnaSasDev to truck-electric.json
---------
Co-authored-by: Jakob Guddas <github@jguddas.de>
Co-authored-by: Eric Fennis <eric.fennis@gmail.com>
* Added icons: pathfinder (unite, minus, exclude, intersect)
* fix(icons): Altered pathfinder icon names to be more descriptive
* fix: Updated subtraction.svg to replace curves with of arcs
Co-authored-by: Jakob Guddas <github@jguddas.de>
* fix(icons): Updated names to be squares-* instead of shape-*
recomended by jguddas
* fix(shapes-unite): Arcified corners & added union tag
* fix(shapes-intersect): Replacing curves with arcs
Done by jguddas
* update(squares-exclude): added extra tags invert & xor
* fix(squares-intersect): Adjusted the look to make it more clear what it's use case is
* fix(icons): Accidentally swapped out the wrong icon for previous commit
* fix(squares-intersect): fixed filename
* fix(squares-exclude): Altered icon to look better under low resolution
Co-Authored-By: Jamie Law <956081+jamiemlaw@users.noreply.github.com>
* fix(squares-subtract): Updated name to fit naming convention better
Co-Authored-By: Jamie Law <956081+jamiemlaw@users.noreply.github.com>
* fix(sqaures-intersect): Removed certain curves for consistency
* fix(squares-exclude): Fixed arcs & arcified corners
Co-authored-by: Jakob Guddas <github@jguddas.de>
* fix(squares-exclude): icon was committed with wrong filename
* update(squares-exclude): updated design to be more readable
Co-Authored-By: Jakob Guddas <25524993+jguddas@users.noreply.github.com>
* fix(tags.json): Reverted accidental prettier alterations
* fix(squares-*.svg): enlarged squares to be more consistant
* fix(squares-*): added karsa-mistmere as a contributor
* fix(squares-subtract): fixed accidental copy made called squares-minus
* fix(squares-subtract): fixed rounding amount on some arcs
---------
Co-authored-by: Jakob Guddas <github@jguddas.de>
Co-authored-by: Jamie Law <956081+jamiemlaw@users.noreply.github.com>
Co-authored-by: Jakob Guddas <25524993+jguddas@users.noreply.github.com>
Co-authored-by: Eric Fennis <eric.fennis@gmail.com>
* Add spline-pointer icon
* Add proper attribution to contributors
* Fix spline-pointer
* Reduce amount of tags and add tools category
* Run SVG to lucide studio
* add saudi riyal sign
* update name from sign to symbol
* fix stroke and fill issue
Co-authored-by: Jakob Guddas <github@jguddas.de>
* removed symbol from the name
---------
Co-authored-by: Jakob Guddas <github@jguddas.de>
Co-authored-by: Eric Fennis <eric.fennis@gmail.com>
* Lucide svelte (#1)
* Update peerDependencies to support Svelte 5
* Bump svelte version
* Bump @testing-library/svelte version
* Remove alias in vitest.config.ts that causes tests to fail due to deprecated svelte/internal API
* Convert to svelte 5 syntax
* Bump vite & @sveltejs/vite-plugin-svelte version
* Fix error during render when children prop is missing & fix components being mounted on the server during tests
* Update test snapshots to reflect the differences in the html generated by svelte 5
* Convert class attribute to new array syntax with built-in clsx
* Convert export template to svelte 5 syntax
* Move svelte 5 to separate directory
* Update snapshots
* Update docs
* fix(icon): change variable declaration from let to const in Icon.svelte
* Lucide svelte (#1) (#2727)
* Update peerDependencies to support Svelte 5
* Bump svelte version
* Bump @testing-library/svelte version
* Remove alias in vitest.config.ts that causes tests to fail due to deprecated svelte/internal API
* Convert to svelte 5 syntax
* Bump vite & @sveltejs/vite-plugin-svelte version
* Fix error during render when children prop is missing & fix components being mounted on the server during tests
* Update test snapshots to reflect the differences in the html generated by svelte 5
* Convert class attribute to new array syntax with built-in clsx
* Convert export template to svelte 5 syntax
* Revert changes in lucide-svelte library
* Update package lock
* Update test files
* Formatting
* Update clean command
* Fix build
* Update packages
* update deps
* Fix export script
* Format code
* Revert version number change in package json
* Update workflows
---------
Co-authored-by: Aurélien Richard <56389380+aurelienrichard@users.noreply.github.com>
* adds border-radius
* Update and rename border-radius.svg to square-round-corner.svg
* Update and rename border-radius.json to square-round-corner.json
---------
Co-authored-by: Jakob Guddas <github@jguddas.de>
* feat(docs): Add deprecated badge for icons with deprecation status
* fix: resolve formatting issues in types.ts to pass Prettier checks
* Small adjustments
---------
Co-authored-by: Eric Fennis <eric.fennis@gmail.com>
The phrase "personally use" is grammatically incorrect. The correct term is "personal use" because "use" is a noun in this context, and "personal" is the adjective that modifies it.
* Fix heading on guide index
Fixes the heading level of a section on the index page of the guide.
* Update docs/guide/index.md
---------
Co-authored-by: Eric Fennis <eric.fennis@gmail.com>
* Added icons/list-filter-plus.svg
* Added icons/list-filter-plus.json
* Move plus to the top line
* Optimize top line and plus gap
* Grid alignment and gap fixes
* Fix gap violation on middle line
* Optimize gap between plus and middle line
* Fix pixel perfect
* Add category `layout` to metadata
* Add reflex to showcase
* flip colors as were wrong way around
* moved to used in section
---------
Co-authored-by: Tom Gotsman <tomgotsman@Toms-MacBook-Pro.local>
Co-authored-by: Eric Fennis <eric.fennis@gmail.com>
Svelte 5 specifics including removing the "ComponentType" typescript type as components are now static.
Also merged some imports into one-liners as we don't need to import each icon in a single line.
* Added tiolet icon
* fixed typo lol
* fixed formatting with SVG
* fixed typo on tags for Toilet
* Updated icon to add more arcs by jguddas
* Updated toilet json to work with linter
* revert teamData.json
* fix(teamData): Reverted accidental changes from Prettier
---------
Co-authored-by: Eric Fennis <eric.fennis@gmail.com>
Co-authored-by: Karsa <contact@karsa.org>
* Update bath.svg
Replaced `<line/>` elements with `<path/>`s and refined the curve of the shower head to use fewer path segments and have a larger radius
* Update bath.json
---------
Co-authored-by: Jakob Guddas <github@jguddas.de>
* Add `air-pressure` icon
And slightly modified the `wind` icon to match
* Rename `air-pressure` to `wind-arrow-down`
And update the JSON file with contributors to the original `wind` icon and add `pressure` as a tag
* Lucidified pizza.svg
Rounded the corners of the pizza slice and spaced out the pepperoni to address the two-pixel-gap rule
* Update pizza.json
* Update pizza.svg
---------
Co-authored-by: Eric Fennis <eric.fennis@gmail.com>
* Add trim to merge classes
* Add trim to merge classes
* Adds extra utils check
* Update packages/shared/src/utils.ts
Co-authored-by: Max Malm <benjick@dumfan.net>
---------
Co-authored-by: Max Malm <benjick@dumfan.net>
* Added icons/calendar-single.svg
* Added icons/calendar-single.json
* Adjust calendar position
Adjust calendar position based on original
* Update name
* Add tag 1
* Optimize 1 path
* Add first tag
---------
Co-authored-by: peteruithoven <peter@metabolic.nl>
* Updated `sandwich` icon
Rounded the top-front corners, and better aligned the top-most corner of the bread, and the corner of the filling to the grid
* Update sandwich.svg
Nudge filling to the left to maintain a two-pixel gap
* Widen the sandwich
* chore(icons): add tag to ellipsis
* chore(icons): add tag to rectangle-ellipsis
* chore(icons): add tag to circle-ellipsis
* chore(icons): add tag to ellipsis-vertical
* chore(): add some further tags. no pun indended.
* chore(): ran prettier
---------
Co-authored-by: Karsa <contact@karsa.org>
* add circle fading up icon
* add more metadata
* Rename circle-fading-up.json to circle-fading-arrow-up.json
* Rename circle-fading-up.svg to circle-fading-arrow-up.svg
* remove categories
Co-authored-by: Eric Fennis <eric.fennis@gmail.com>
* remove comma
* added development category
---------
Co-authored-by: Jakob Guddas <github@jguddas.de>
Co-authored-by: Eric Fennis <eric.fennis@gmail.com>
gh issue close ${{ github.event.issue.number }} --reason "not planned" --comment "This looks like a duplicate, use the [search](https://github.com/lucide-icons/lucide/issues?q=is%3Aissue+$PHRASE) to find similar issues.
Read more about brand guideline rules at [We're not accepting new Brand icons #670](https://github.com/lucide-icons/lucide/issues/670).
Always happy to help on [Discord](https://discord.gg/EH6nSts)."
- __Make your commit messages as descriptive as possible.__ Include as much information as you can. Explain anything that the file diffs themselves won’t make apparent.
- __Document your pull request__. Explain your fix, link to the relevant issue, add screenshots when adding new icons.
- __Make sure the target of your pull request is the relevant branch__. Most of bugfix or new feature should go to the `main` branch.
- __Include only related work__. If your pull request has unrelated commit, it won't be accepted.
- __Make sure the target of your pull request is the relevant branch__. Most of bugfixes or new feature should go to the `main` branch.
- __Include only related work__. If your pull request has unrelated commits, it won't be accepted.
### Pull Requests Including Icons
### Icon Pull Requests
#### Guidelines
@@ -27,26 +27,30 @@ Please make sure you follow the icon guidelines, that should be followed to keep
Read it here: [ICON_GUIDELINES](https://lucide.dev/docs/icon-design-guide).
### Editor guides
#### Lucide Studio
For formatting and adjusting SVG icons, [@jguddas](https://github.com/jguddas) made a great tool called [Lucide Studio](https://studio.lucide.dev/). It is a web-based SVG editor that allows you to edit and adjust icons in the Lucide style. You can use it to create new icons or modify existing ones.
#### Editor guides
Here you can find instructions on how to implement the guidelines with different vector graphics editors:
If you want submit multiple icons, please separate the icons and group them. That makes reviewing the icons easier and keep the thread clean and scoped.
So don't submit multiple icons in one PR that have noting to do with each other.
If you want to submit multiple icons, please separate the icons and group them. That makes reviewing the icons easier and keeps the thread clean and scoped.
So don't submit multiple icons in one PR that have nothing to do with each other.
So for example don't create one PR with icons: `arrow-up`, `bicycle`, `arrow-down`.
Seperate them by two PRs; 'pr-01' `arrow`, `arrow-down` and 'pr-02' `bicycle`.
Separate them into two PRs; 'pr-01' `arrow`, `arrow-down` and 'pr-02' `bicycle`.
## Icon Requests
@@ -72,12 +76,12 @@ pnpm install # Install dependencies, including the workspace packages
### Packages -> PNPM Workspaces
To distribute different packages we use PNPM workspaces. Before you start make sure you are familiar with this concept. The concept of working in workspaces is created by Yarn, they have a well written introduction: [yarn workspaces](https://classic.yarnpkg.com/lang/enhttps://lucide.dev/docs/workspaces).
To distribute different packages we use [PNPM workspaces](https://pnpm.io/workspaces). Before you start make sure you are familiar with this concept. The concept of working in workspaces is created by Yarn, they have a well written introduction: [yarn workspaces](https://classic.yarnpkg.com/en/docs/workspaces).
The configured directory for workspaces is the [packages](https://github.com/lucide-icons/lucide/tree/main/packages) directory, located in the root directory. There you will find all the current packages from lucide.
There are more workspaces defined, see [`pnpm-workspace.yaml`](https://github.com/lucide-icons/lucide/blob/main/pnpm-workspace.yaml).
> Note: One package is not managed by pnpm: **lucide-flutter**, this package is written in Dart and used pub for publishing.
> Note: One package is not managed by pnpm: **lucide-flutter**, this package is written in Dart and uses pub for publishing.
### Generated Code
@@ -127,7 +131,7 @@ When adding new features to for example the icon component for a framework. It i
### Local Testing
To test changes in a local project, you can use `yarn link`, `npm link` or `pnpm link` to link the package. Before you do this make sure you builded the package first.
To test changes in a local project, you can use `yarn link`, `npm link`, `bun link` or `pnpm link` to link the package. Before you do this make sure you've built the package first.
```sh
# in packages/lucide-react
@@ -157,6 +161,30 @@ lucide
The lucide.dev website is using [vitepress](https://vitepress.dev/) to generate the static website. The markdown files are located in the docs directory.
#### Running the Docs Website Locally
To test the docs website locally, follow these steps:
1.**Navigate to the docs directory**
```sh
cd docs
```
2.**Start the Local Development Server**
```sh
pnpm run docs:dev
```
3.**Open the Website Locally**
Vitepress should open with the following format:
VitePress dev server is running at:
- **Local**: `http://localhost:3000/`
- **Network**: `http://192.168.x.x:3000/`
### Guides
Detailed documentation about: installation, guides, packages, design guides etc.
All the icons of lucide in SVG format. These will be used as source for all the packages and other distributions for the lucide icons.
### packages
### Packages
Includes all the (npm) packages of lucide.
> Note: One package is not managed by pnpm: **lucide-flutter**, this package is written in Dart and used pub for publishing.
### Scripts
### scripts
Includes usefully scripts to automate certain jobs. Big part of the scripts is the template generation, for example it generates icon components for all the packages. These scripts are usually executed from the "scripts" section in the package.json.
Includes useful scripts to automate certain jobs. Big part of the scripts is the template generation, for example it generates icon components for all the packages. These scripts are usually executed from the "scripts" section in the package.json.
## Documentation
@@ -190,4 +216,4 @@ If you need any help or have problems with you contribution. Please don't hesita
Thank you to all the people who already contributed to Lucide!
Community-run fork of [Feather Icons](https://github.com/feathericons/feather), open for anyone to contribute icons.
Lucide is an open-source icon library that provides 1000+ 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](https://lucide.dev/packages) to make it easier to use these icons in your project.
It began after growing dissatisfaction with the [Feather Icons](https://github.com/feathericons/feather) project moderation. With over 300+ open issues and over 100+ open PRs, the Feather Icons project has been abandoned. This unfortunately means that hundreds of developers and designers wasted their time contributing to Feather Icons with no chance of PRs being accepted.
## Packages
Lucide is trying to expand the icon set as much as possible while staying faithful to the original simplistic design language. We do this as a community of devs and designers and hope that you'll join us!
### Why choose Lucide over Feather Icons
- More icons to work with: Lucide already has hundreds of icons more than Feather does.
- Official libraries and integrations with popular frameworks and design tools.
- Well maintained code base.
- Active community, regularly growing and improving the set.
At its core, Lucide is a collection of [SVG](https://svgontheweb.com/#svg) files. This means that you can use Lucide icons in all the same ways you can use SVGs (e.g. `img`, `background-image`, `inline`, `object`, `embed`, `iframe`). Here's a helpful article detailing the many ways SVGs can be used on the web: [SVG on the Web – Implementation Options](https://svgontheweb.com/#implementation)
The following are additional ways you can use Lucide.
With the Javascript library you can easily incorporate the icon you want in your webpage.
### Web
Implementation of the lucide icon library for web applications.
```sh
npm install lucide
```
or
```sh
yarn add lucide
```
For more details, see the [documentation](https://github.com/lucide-icons/lucide/tree/main/packages/lucide#lucide).
### React
Implementation of the lucide icon library for react applications.
```sh
yarn add lucide-react
```
or
```sh
npm install lucide-react
```
For more details, see the [documentation](https://github.com/lucide-icons/lucide/tree/main/packages/lucide-react#lucide-react).
### React Native
Implementation of the lucide icon library for React Native applications.
```sh
yarn add lucide-react-native
```
or
```sh
npm install lucide-react-native
```
For more details, see the [documentation](https://github.com/lucide-icons/lucide/tree/main/packages/lucide-react-native#lucide-react-native).
### Vue 2
Implementation of the lucide icon library for vue applications.
```sh
yarn add lucide-vue
```
or
```sh
npm install lucide-vue
```
For more details, see the [documentation](https://github.com/lucide-icons/lucide/tree/main/packages/lucide-vue#lucide-vue).
### Vue 3
Implementation of the lucide icon library for vue applications.
```sh
yarn add lucide-vue-next
```
or
```sh
npm install lucide-vue-next
```
For more details, see the [documentation](https://github.com/lucide-icons/lucide/tree/main/packages/lucide-vue-next#lucide-vue-next).
### Angular
```sh
yarn add lucide-angular
```
or
```sh
npm install lucide-angular
```
For more details, see the [documentation](https://github.com/lucide-icons/lucide/tree/main/packages/lucide-angular#lucide-angular).
### Preact
Implementation of the lucide icon library for preact applications.
```sh
yarn add lucide-preact
```
or
```sh
npm install lucide-preact
```
For more details, see the [documentation](https://github.com/lucide-icons/lucide/tree/main/packages/lucide-preact#lucide-preact).
For more details, see the [documentation](https://github.com/Siteation/magento2-hyva-icons-lucide/blob/main/README.md).
### Eleventy
Using this plugin, Eleventy projects can incorporate Lucide icons. it makes it simple to use Lucide icons into your themes via shortcodes, improving your website's overall usability and visual appeal.
For more details, see the [documentation](https://github.com/GrimLink/eleventy-plugin-lucide-icons/blob/main/README.md).
## Contributing
For more info on how to contribute please see the [contribution guidelines](https://github.com/lucide-icons/lucide/blob/main/CONTRIBUTING.md).
@@ -270,14 +63,16 @@ Join the community on our [Discord](https://discord.gg/EH6nSts) server!
## License
Lucide is totally free for commercial use and personally use, this software is licensed under the [ISC License](https://github.com/lucide-icons/lucide/blob/main/LICENSE).
Lucide is totally free for commercial use and personal use, this software is licensed under the [ISC License](https://github.com/lucide-icons/lucide/blob/main/LICENSE).
## Credits
Thank you to all the people who contributed to Lucide!
Icons can have multiple names for the same icon. This is because we choose to rename some icons to make them more consistent with the rest of the icon set, or the name was not generic. For example, the `edit-2` icon is renamed to `pen` to make the name more generic, since it is just a pen icon.
Beside aliases names lucide also includes prefixed and suffixed names to use within your project. This is to prevent import name collisions with other libraries or your own code.
```tsx
// These are all the same icon
import{
House,
HouseIcon,
LucideHouse,
}from"lucide-react";
```
## Choosing import name style
To be consistent in your imports or want to change the autocompletion of Lucide icons in your IDE there an option to able the choose the import name style you want.
This can be done by creating a custom module declaration file to override the lucide imports and turning off the autocomplete in your IDE.
@@ -12,7 +12,8 @@ Lucide is an open-source icon library that provides 1000+ vector (svg) files for
## Available Icons
Lucide contains icons with different variants and states, allowing users to choose the most suitable icon for their needs. And if a desired icon isn't available yet, users can open a design request, and the Lucide community contributors will help provide new icons. With more icons to choose from, users have more options to work with in their projects.
Complete Set of Icons
### Complete Set of Icons
As new applications with specific features arise, Lucide aims to provide a complete set of icons for every project. The community follows a set of design rules when designing new icons. These rules maintain standards for the icons, such as recognizability, consistency in style, and readability at all sizes. While creativity is valued in new icons, recognizable design conventions are important to ensure that the icons are easily identifiable by users.
@@ -28,7 +29,8 @@ However, not everyone can understand them easily. Read more about [how to use Lu
## Official Packages
Lucide's official packages are designed to work on different platforms, making it easier for users to integrate icons into their projects. The packages are available for various technologies, including [Web (Vanilla)](https://lucide.dev/guide/packages/lucide), [React](https://lucide.dev/guide/packages/lucide-react), [React Native](https://lucide.dev/guide/packages/lucide-react-native), [Vue](https://lucide.dev/guide/packages/lucide-vue), [Vue 3](https://lucide.dev/guide/packages/lucide-vue-next), [Svelte](https://lucide.dev/guide/packages/lucide-svelte),[Preact](https://lucide.dev/guide/packages/lucide-preact), [Solid](https://lucide.dev/guide/packages/lucide-solid), [Angular](https://lucide.dev/guide/packages/lucide-angular), [NodeJS](https://lucide.dev/guide/packages/lucide-static#nodejs) and [Flutter](https://lucide.dev/guide/packages/lucide-flutter).
Lucide's official packages are designed to work on different platforms, making it easier for users to integrate icons into their projects. The packages are available for various technologies, including [Web (Vanilla)](https://lucide.dev/guide/packages/lucide), [React](https://lucide.dev/guide/packages/lucide-react), [React Native](https://lucide.dev/guide/packages/lucide-react-native), [Vue](https://lucide.dev/guide/packages/lucide-vue), [Vue 3](https://lucide.dev/guide/packages/lucide-vue-next), [Svelte](https://lucide.dev/guide/packages/lucide-svelte),[Preact](https://lucide.dev/guide/packages/lucide-preact), [Solid](https://lucide.dev/guide/packages/lucide-solid), [Angular](https://lucide.dev/guide/packages/lucide-angular), [Astro](https://lucide.dev/guide/packages/lucide-astro), and [NodeJS](https://lucide.dev/guide/packages/lucide-static#nodejs).
## Community
If you have any questions about Lucide, feel free to reach out to the community. You can find them on [GitHub](https://github.com/lucide-icons/lucide) and [Discord](https://discord.gg/EH6nSts).
For more details, see the [documentation](packages/lucide.md).
@@ -44,6 +48,10 @@ yarn add lucide-react
npm install lucide-react
```
```sh [bun]
bun add lucide-react
```
:::
For more details, see the [documentation](packages/lucide-react.md).
@@ -67,6 +75,10 @@ yarn add lucide-vue-next
npm install lucide-vue-next
```
```sh [bun]
bun add lucide-vue-next
```
:::
For more details, see the [documentation](packages/lucide-vue-next.md).
@@ -90,6 +102,10 @@ yarn add lucide-svelte
npm install lucide-svelte
```
```sh [bun]
bun add lucide-svelte
```
:::
For more details, see the [documentation](packages/lucide-svelte.md).
@@ -112,6 +128,10 @@ yarn add lucide-solid
npm install lucide-solid
```
```sh [bun]
bun add lucide-solid
```
:::
For more details, see the [documentation](packages/lucide-solid.md).
@@ -134,6 +154,10 @@ yarn add lucide-angular
npm install lucide-angular
```
```sh [bun]
bun add lucide-angular
```
:::
For more details, see the [documentation](packages/lucide-angular.md).
@@ -156,8 +180,41 @@ yarn add lucide-preact
npm install lucide-preact
```
```sh [bun]
bun add lucide-preact
```
:::
For more details, see the [documentation](packages/lucide-preact.md).
## Astro
Implementation of the lucide icon library for Astro applications.
::: code-group
```sh [pnpm]
pnpm install @lucide/astro
```
```sh [yarn]
yarn add @lucide/astro
```
```sh [npm]
npm install @lucide/astro
```
```sh [bun]
bun add @lucide/astro
```
:::
For more details, see the [documentation](packages/lucide-astro.md).
## Static usage
Implementation of the lucide icon library for multiple usages that like to use: SVG files icons, SVG Sprite, Icon Fonts and static SVG strings export in Common JS modules (for NodeJS).
@@ -176,6 +233,10 @@ yarn add lucide-static
npm install lucide-static
```
```sh [bun]
bun add lucide-static
```
:::
For more details, see the [documentation](packages/lucide-static.md).
Implementation of the lucide icon library for Astro applications.
## Installation
::: code-group
```sh [pnpm]
pnpm add @lucide/astro
```
```sh [yarn]
yarn add @lucide/astro
```
```sh [npm]
npm install @lucide/astro
```
```sh [bun]
bun add @lucide/astro
```
:::
## How to use
Lucide is built with ES Modules, so it's completely tree-shakable.
Each icon can be imported as an Astro component, which renders an inline SVG element. This way, only the icons that are imported into your project are included in the final bundle. The rest of the icons are tree-shaken away.
### Example
Default usage:
```astro
---
import { Skull } from '@lucide/astro';
---
<Skull />
```
Additional props can be passed to adjust the icon:
```astro
---
import { Camera } from '@lucide/astro';
---
<Camera color="#ff3e98" />
```
For faster builds and load times, you can import icons directly from the `@lucide/astro/icons` directory:
```astro
---
import CircleAlert from '@lucide/astro/icons/circle-alert';
To customize the appearance of an icon, you can pass custom properties as props directly to the component. The component accepts all SVG attributes as props, which allows flexible styling of the SVG elements. See the list of SVG Presentation Attributes on [MDN](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/Presentation).
```astro
---
import { Phone } from '@lucide/astro';
---
<Phone fill="#333" />
```
This results a filled phone icon.
## Types
The package includes type definitions for all icons. This is useful if you want to dynamically render icons.
### Example
```astro
---
import { House, Library, Cog, type Icon as IconType } from '@lucide/astro';
type MenuItem = {
name: string;
href: string;
icon: typeof IconType;
};
const menuItems: MenuItem[] = [
{
name: 'Home',
href: '/',
icon: House,
},
{
name: 'Blog',
href: '/blog',
icon: Library,
},
{
name: 'Projects',
href: '/projects',
icon: Cog,
},
];
---
{
menuItems.map((item) => (
<a href={item.href}>
<item.icon />
<span>{item.name}</span>
</a>
))
}
```
## With Lucide lab or custom icons
[Lucide lab](https://github.com/lucide-icons/lucide-lab) is a collection of icons that are not part of the Lucide main library.
They can be used by using the `Icon` component.
All props of the regular Lucide icons can be passed to adjust the icon appearance.
### Using the `Icon` component
This creates a single icon based on the iconNode passed and renders a Lucide icon component.
```astro
---
import { Icon } from '@lucide/astro';
import { burger, sausage } from '@lucide/lab';
---
<Icon iconNode={burger} />
<Icon iconNode={sausage} color="red"/>
```
## One generic icon component
It is possible to create one generic icon component to load icons, but it is not recommended.
::: danger
The example below imports all ES Modules, so exercise caution when using it. Importing all icons will significantly increase the build size of the application. This may be passable if you're doing SSG and SSR in server environments. However if you're doing SSR in serverless environments, it could negatively affect your app's performance, as a bigger bundle size will translate to an increase in cold starts.
:::
### Icon Component Example
```astro
---
import { icons, type IconProps } from '@lucide/astro';
@@ -74,115 +78,27 @@ This creates a single icon based on the iconNode passed and renders a Lucide ico
```jsx
import { Icon } from 'lucide-react';
import { burger } from '@lucide/lab';
import { coconut } from '@lucide/lab';
const App = () => (
<Icon iconNode={burger} />
<Icon iconNode={coconut} />
);
```
## One generic icon component
## Dynamic Icon Component
It is possible to create one generic icon component to load icons, but it is not recommended.
It is possible to create one generic icon component to load icons. But it is not recommended, since it is importing all icons during the build. This increases build time and the different modules it will create.
::: danger
The example below imports all ES Modules, so exercise caution when using it. Importing all icons will significantly increase the build size of the application, negatively affecting its performance. This is especially important to keep in mind when using bundlers like `Webpack`, `Rollup`, or `Vite`.
`DynamicIcon` is useful for applications that want to show icons dynamically by icon name. For example, when using a content management system with where icon names are stored in a database.
This is not the case for the latest NextJS, because it uses server side rendering. The icons will be streamed to the client when needed. For NextJS with Dynamic Imports, see [dynamic imports](#nextjs-example) section for more information.
:::
For static use cases, it is recommended to import the icons directly.
### Icon Component Example
The same props can be passed to adjust the icon appearance. The `name` prop is required to load the correct icon.
```jsx
import { icons } from 'lucide-react';
import { DynamicIcon } from 'lucide-react/dynamic';
const Icon = ({ name, color, size }) => {
const LucideIcon = icons[name];
return <LucideIcon color={color} size={size} />;
};
export default Icon;
```
#### Using the Icon Component
```jsx
import Icon from './Icon';
const App = () => {
return <Icon name="Home" />;
};
export default App;
```
#### With Dynamic Imports
Lucide react exports a dynamic import map `dynamicIconImports`, which is useful for applications that want to show icons dynamically by icon name. For example, when using a content management system with where icon names are stored in a database.
When using client side rendering, it will fetch the icon component when it's needed. This will reduce the initial bundle size.
The keys of the dynamic import map are the lucide original icon names (kebab case).
Example with React suspense:
```tsx
import React, { lazy, Suspense } from 'react';
import { LucideProps } from 'lucide-react';
import dynamicIconImports from 'lucide-react/dynamicIconImports';
In NextJS, [the dynamic function](https://nextjs.org/docs/pages/building-your-application/optimizing/lazy-loading#nextdynamic) can be used to dynamically load the icon component.
To make dynamic imports work with NextJS, you need to add `lucide-react` to the [`transpilePackages`](https://nextjs.org/docs/app/api-reference/next-config-js/transpilePackages) option in your `next.config.js` like this:
```js
/** @type {import('next').NextConfig} */
const nextConfig = {
transpilePackages: ['lucide-react'] // add this
}
module.exports = nextConfig
```
You can then start using it:
```tsx
import dynamic from 'next/dynamic'
import { LucideProps } from 'lucide-react';
import dynamicIconImports from 'lucide-react/dynamicIconImports';
This package include the following lucide implementations:
This package includes the following implementations of Lucide icons:
-All SVG files
-Individual SVG files
- SVG sprite
- Icon fonts
- JavaScript library containing strings of SVGs.
- Icon font files
- A JavaScript library exporting SVG strings
## Why lucide-static?
## Who is this for?
This package is suitable for specific use cases, for example if you want to use icon fonts, SVG sprites, normal SVGs or Common.js SVG strings in your javascript project.
`lucide-static` is suitable for _very specific use cases_ where you want to use Lucide icons without relying on a JavaScript framework or component system. It's ideal for:
::: warning
While they can be useful for prototyping, it is not recommended to use the SVG sprites or icon fonts provided by this package in production web apps as all the available icons are included in the app, hence increasing loading time and data usage. We recommend to use a bundler and tree-shaking to make sure only the icons you use are bundled with your app. Tree-shaking is only available in these packages: [lucide](lucide), [lucide-react](lucide-react), [lucide-vue](lucide-vue), [lucide-vue-next](lucide-vue-next), [lucide-angular](lucide-angular), [lucide-preact](lucide-preact)
- Projects that use icon fonts with plain CSS or utility-first frameworks
- Embedding raw SVG files or sprites directly in HTML
- Using SVGs as CSS background images
- Importing SVG strings into Node.js (CommonJS) environments
::: danger
### Not recommended for production {#production-warning}
SVG sprites and icon fonts include **all icons**, which can significantly increase your app's bundle size and load time.
For production environments, we recommend using a bundler with tree-shaking support to include only the icons you actually use. Consider using:
- [lucide](lucide)
- [lucide-react](lucide-react)
- [lucide-vue](lucide-vue)
- [lucide-vue-next](lucide-vue-next)
- [lucide-angular](lucide-angular)
- [lucide-preact](lucide-preact)
:::
## Installation
## Package Managers
::: code-group
```sh [pnpm]
@@ -33,66 +47,83 @@ yarn add lucide-static
npm install lucide-static
```
```sh [bun]
bun add lucide-static
```
:::
### CDN
## SVG Files
```html
You can use standalone SVG files or SVG sprites in several ways.
Check out our [codesandbox example](https://codesandbox.io/s/using-the-svg-sprite-lz1kk).
To use lucide icons in your Nodejs project you can import each icon as:
:::
Once included, use the format `icon-{kebab-case-name}`. You can copy icon names from the [Lucide Icons page](https://lucide.dev/icons).
```html
<div class="icon-house"></div>
```
If you're not using a package manager, you can download the font files directly from the [latest release](https://github.com/lucide-icons/lucide/releases/latest).
## Node.js
You can also import Lucide icons in Node.js (CommonJS) projects:
@@ -162,8 +246,18 @@ The package includes type definitions for all icons. This is useful if you want
}
];
</script>
{#each menuItems as item}
{@const Icon = item.icon}
<a href={item.href}>
<Icon />
<span>{item.name}</span>
</a>
{/each}
```
:::
For more details about typing the `svelte:component` directive, see the [Svelte documentation](https://svelte.dev/docs/typescript#types-componenttype).
## With Lucide lab or custom icons
@@ -179,11 +273,11 @@ This creates a single icon based on the iconNode passed and renders a Lucide ico
```svelte
<script>
import { Icon } from 'lucide-svelte';
import { burger, sausage } from '@lucide/lab';
import { Icon } from '@lucide/svelte';
import { pear, sausage } from '@lucide/lab';
</script>
<Icon iconNode={burger} />
<Icon iconNode={pear} />
<Icon iconNode={sausage} color="red"/>
```
@@ -197,15 +291,30 @@ The example below imports all ES Modules, so exercise caution when using it. Imp
Implementation of the lucide icon library for Vue applications.
::: warning
This package will be deprecated end of 2023. Vue v2 will be EOF at the end of 2023 See [Announcement](https://v2.vuejs.org/lts/). We recommend to migrate to Vue 3.
The Lucide Vue package will be only maintained for Vue 3 after the deprecation.
:::
## Vue 2 or Vue 3
::: tip
This version of lucide is for Vue 2, For Vue 3 go to [lucide-vue-next ->](lucide-vue-next)
::: danger
This package is deprecated. Vue 2 is EOF See [Announcement](https://v2.vuejs.org/eol/). Migrate to Vue 3.
Some files were not shown because too many files have changed in this diff
Show More
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.