Language: JavaScript
Icons
Lucide was created as a fork and improvement of the Feather Icons library, focusing on accessibility, customizability, and modern design principles. It is designed to be developer-friendly, with scalable SVG icons that can be styled with CSS and adapted to any project.
Lucide is a simple, consistent, and customizable icon library for web projects. It offers a wide range of open-source, SVG-based icons that are lightweight and easy to integrate.
npm install lucide-reactyarn add lucide-react<script src='https://unpkg.com/lucide/dist/umd/lucide.min.js'></script>Download individual SVG icons or the full package and include them in your project.Lucide icons can be used as React components, SVG elements, or directly in HTML. They are easily customizable via props like `size`, `color`, and `strokeWidth`, or via CSS classes.
import { Activity } from 'lucide-react';
function App() {
return <Activity size={24} color='blue' />;
}Imports the `Activity` icon from Lucide and renders it in a React component with a specific size and color.
<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' class='lucide lucide-activity'>
<path d='M22 12h-4l-3 8-4-16-3 8H2'></path>
</svg>Uses Lucide icon directly as an inline SVG element, which can be styled via CSS.
<Activity strokeWidth={1.5} color='red' size={32} />Demonstrates adjusting stroke width, color, and size for a Lucide icon in React.
import { Activity, Airplay } from 'lucide-react';
function IconRow() {
return (
<div>
<Activity size={20} />
<Airplay size={20} />
</div>
);
}Shows how to import and render multiple Lucide icons together in a React component.
<Activity className='text-green-500 hover:text-green-700 transition-all' size={24} />Demonstrates using Tailwind CSS classes (or any CSS) to style Lucide icons dynamically.
Import only the icons you need to reduce bundle size.
Use size and color props for consistent styling across your app.
Leverage CSS classes for hover, transitions, and responsive adjustments.
Use inline SVG or React components depending on your framework for maximum flexibility.
Keep icons accessible by providing `aria-label` or `title` when necessary.