# Lucide The core Lucide package for vanilla JavaScript applications. This package allows you to easily add scalable vector icons to any web project without framework dependencies. Perfect for static websites, legacy applications, or when you need lightweight icon integration with maximum browser compatibility. **What you can accomplish:** - Add icons to HTML using simple data attributes - Dynamically create and insert SVG icons with JavaScript - Customize icon appearance with CSS classes and inline styles - Tree-shake unused icons to keep bundle sizes minimal - Use icons in any JavaScript environment or plain HTML ## Installation ### Package Managers ::: code-group ```sh [pnpm] pnpm add lucide ``` ```sh [yarn] yarn add lucide ``` ```sh [npm] npm install lucide ``` ```sh [bun] bun add lucide ``` ::: ### CDN ```html ``` ## Usage ### With unpkg Here is a complete example with unpkg ```html ``` ### With ESModules To reduce bundle size, lucide is built to be fully tree-shakable. The `createIcons` function will search for HTMLElements with the attribute `data-lucide` and replace it with the svg from the given icon name. ```html ``` ```js import { createIcons, icons } from 'lucide'; // Caution, this will import all the icons and bundle them. createIcons({ icons }); // Recommended way, to include only the icons you need. import { createIcons, Menu, ArrowRight, Globe } from 'lucide'; createIcons({ icons: { Menu, ArrowRight, Globe } }); ``` ## Advanced Usage ### Additional Options In the `createIcons` function you can pass some extra parameters: - you can pass `nameAttr` to adjust the attribute name to replace for - you can pass `attrs` to pass additional custom attributes, for instance CSS classes or stroke options. - you can pass `root` to provide a custom DOM element the icons should be replaced in (useful when manipulating small sections of a large DOM or elements in the shadow DOM) - you can pass `inTemplates: true` to also replace icons inside `