New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

lucide-svelte

Package Overview
Dependencies
Maintainers
1
Versions
482
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lucide-svelte

A Lucide icon library package for Svelte applications

  • 0.17.13
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
121K
increased by27.17%
Maintainers
1
Weekly downloads
 
Created
Source

Lucide Svelte

Implementation of the lucide icon library for svelte applications.

What is lucide? Read it here.

Installation

yarn add lucide-svelte

# or

npm install lucide-svelte

How to use

All the icons are Svelte components, that ouputs Svg elements. So each icon can be imported and used as a component. This also helps with the use of threeshaking so you only import the icons you use.

Example

Default usage:

<script>
import { Skull } from 'lucide-svelte'
</script>

<Skull/>

You can pass additional props to adjust the icon.

<script>
import { Camera } from 'lucide-svelte'
</script>

<Camera />

Available props

nametypedefault
sizeNumber24
colorStringcurrentColor
strokeWidthNumber2
*<SVGProps>String-
  • All SVGProps are available to style the svgs. See the list of SVG Presentation Attributes on MDN

Example of custom props

<script>
import { Phone } from 'lucide-svelte'
</script>

<Phone fill="#333"/>

This results a filled phone icon.

One generic icon component

It is possible to create one generic icon component to load icons.

:warning: Example below importing all EsModules, caution using this example, not recommended when you bundle your application,the build size will grow strongly. Because it will import all the icons.

Icon Component Example
<script>
  import * as icons from "lucide-svelte";
  export let name;
</script>

<svelte:component this={icons[name]} {...$$props}/>
Then you can use it like this
<script>
  import LucideIcon from "./LucideIcon";
</script>

<LucideIcon name="Menu" />

FAQs

Package last updated on 21 Mar 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc