Adding Icons
Set Up
- Install the following packages:
- Resolve the className strings into icon styles
Add the iconWithClassName
function in the ~/lib/icons/iconWithClassName.ts
file.
- Create a file for each Icon component
Create Icon Components
Wrap your icon components with iconWithClassName
to add a class name to the icon.
Create a file for each icon in ~/lib/icons/
Wrap your icon components with iconWithClassName
to add a class name to the icon.
First, create a new file in the ~/lib/icons/
directory with the name of the LucideIcon.
Then, in each file:
- Import the Icon from LucideIcon
- Import the
iconWithClassName
function
- Call the
iconWithClassName
function and pass the icon as its argument
- Export the Icon as a named export
Examples
Sun
MoonStar