Skip to main content

Lucide

What is Lucide?

Lucide is an evolution of Feather Icons featuring MIT-licensed SVG icons maintained by the community. Technical highlights:

  • Vector Scalability: Pure SVG implementation ensures sharp rendering at any resolution
  • Framework Agnostic: Core package (@lucide/icons) + framework-specific wrappers (React, Vue, Svelte)
  • TypeScript Support: First-class type definitions included
  • Semantic Versioning: Stable API following semver conventions
# Installation
npm install lucide
# React specific
npm install @lucide/react

Implementation Guide

Web (Vanilla JS)

<script src="https://unpkg.com/lucide@latest"></script>
<script>
// Initialize with options
lucide.createIcons({
strokeWidth: 1.5,
class: "icon-class",
});
</script>

React Component

import { Camera } from "lucide-react";

// Customizable via props
<Camera size={24} color="#ff0000" strokeWidth={1.5} className="custom-class" />;

Advanced Features

  1. Tree Shaking Optimization: Import individual icons to minimize bundle sizes:
import { AlertCircle } from "lucide";
// Bundle size: only 1.2kb (gzipped)
  1. Dynamic Loading:
const LazyIcon = React.lazy(() =>
import("lucide-react").then((module) => ({
default: module.Smile,
}))
);
  1. CSS Customization:
.icon-class {
stroke-dasharray: 5;
filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

Design Integration

  • Figma File: Official design resources available at lucide.dev/figma
  • Style Inheritance:
    <div style="stroke: #555; stroke-width: 1.2">
    <i data-lucide="mail"></i>
    </div>

Performance Comparison

FeatureLucideFeatherMaterial Icons
Average Size2.1KB5.8KB42KB
Tree ShakingYesPartialNo
SVG SpriteYesNoNo

Migration from Feather

npm uninstall feather-icons
npm install lucide

Update imports:

// Before
import { icon } from "feather-icons";

// After
import { Icon } from "lucide";

Contribution Workflow

  1. Clone the repository
  2. Create SVG files in icons/ directory
  3. Run icon build process:
pnpm build
  1. Submit pull request with new SVG files

Full contributor guide →