swappable strand, which changes how you import from it.
Import through the registry’s icon module
lib/icons re-exports the icon library. Importing through it rather than reaching for
lucide-react directly is the whole mechanism by which an adopter can swap the icon library
and inherit everything else unchanged — an import scattered across two hundred components is
not a seam.
Import specific icons, never the whole library, so tree-shaking works.
Sizing
Use the
size-* shorthand, which sets width and height together, rather than separate h-*
and w-* classes that can drift apart.
Common icons
Navigation
Actions
Status
Accessibility
Icon-only controls
An icon without visible text needs an accessible name:Decorative icons
An icon beside visible text is decorative and should be hidden from assistive technology:aria-hidden="true" by default, so this is usually handled for you.
Colour
Icons inherit colour throughcurrentColor. Use text colour utilities and semantic tokens:
--status-success rather than --color-malachite
— so the icon follows the theme rather than pinning a colour.