The Icon component renders an icon from Lucide React. Icons are lazy-loaded to prevent increasing bundle size.
Icon
className
custom styles
optional
SCSS or Tailwind
color
icon outline color
string (light/dark/green/blue/orange/red) default: dark
name
icon name
required
string (see Lucide Icons)
size
icon size
integer, default: 16
The Icon component uses lazy, Suspense, and useMemo from React to handle lazy loading of icons.
lazy
Suspense
useMemo
The name prop specifies the icon image to use and converts it to PascalCase if necessary.
The color and fill props allow for customizing the outline and fill colors of the icon.
fill
Icons are loaded from the lucide-react library.
lucide-react
Last updated 2 years ago
import { Icon } from 'components/lib'; function MyComponent({ ...props }){ return ( <div> <Icon name='alert-circle' size={ 16 } color='red' /> <Icon name='check' size={ 24 } color='#10b981' /> </div> ); }