github lucide-icons/lucide v0.17.0
Add slot support for icons

latest releases: 0.461.0, 0.460.1, 0.460.0...
2 years ago

New Package 📦

Lucide is now supported in Svelte with new package lucide-svelte.

Code improvements ⚡

Slots are now supported in lucide-react, lucide-vue, lucide-vue-next, lucide-preact, lucide-svelte.
Now you can pass children to Icon components. This can help improving accessibility or make it possible to render custom SVGElements over the icon.

Examples

Rendering title and description

This also improves accessibility, and enables the browser native tooltip.

<Icon>
  <title>My awesome text</title>
  <desc>More detailed description about the icon</desc>
</Icon>

Rendering for example a visual text SVGElement over the icon, for example render a ShoppingCart with a number.

With this you can now render custom elements inside Lucide icons, enables you to

<ShoppingCart>
  <text>5</text>
</ShoppingCart>

See codesandbox

Don't miss a new lucide release

NewReleases is sending notifications on new releases.