Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
svelte-lucide
Advanced tools
Lucide-icons for Svelte. Support all major CSS frameworks using the class
prop.
Thank you for considering my open-source package. If you use it in a commercial project, please support me by sponsoring me on GitHub: https://github.com/sponsors/shinokada. Your support helps me maintain and improve this package for the benefit of the community.
npm i -D svelte-lucide
In a svelte file:
<script>
import { Accessibility, Activity, Airplay } from 'svlete-lucide';
</script>
<Accessibility />
<Activity />
<Airplay />
If you need only a few icons from this library in your Svelte app, import them directly. This can optimize compilation speed and improve performance by reducing the amount of code processed during compilation.
<script>
import Accessibility from 'svelte-lucide/Accessibility.svelte';
</script>
<Accessibility />
If you are a TypeScript user, install typescript version 5.0.0 or above.
As of March 2023, the typescript@beta
version is now available:
pnpm i -D typescript@beta
To avoid any complaints from the editor, add node16
or nodenext
to moduleResolution
in your tsconfig.json file.
{
//...
"compilerOptions": {
// ...
"moduleResolution": "nodenext"
}
}
If you are using an LSP-compatible editor, such as VSCode, Atom, Sublime Text, or Neovim, hovering over a component name will display a documentation link, features, props, events, and an example.
Use the size
prop to change the size of icons.
<script>
import { Accessibility, Activity, Airplay } from 'svlete-lucide';
</script>
<Accessibility size="30" />
<Activity size="42" />
<Airplay size="51" />
Use the color
prop to change colors with HEX color code.
<script>
import { Accessibility, Activity, Airplay } from 'svlete-lucide';
</script>
<Accessibility color="#c61515" />
<Activity color="#3759e5" />
<Airplay color="#3fe537" />
Use the class
prop to change colors and add additional css.
Tailwind example:
<script>
import { Accessibility, Activity, Airplay } from 'svlete-lucide';
</script>
<Accessibility class="text-blue-700 mr-4" />
<Activity class="text-red-700" />
<Airplay class="text-green-500" />
Bootstrap example:
<Accessibility class="position-absolute top-0 px-1" />
If you are using the dark mode on your website with Tailwind CSS, add your dark mode class to the class
prop.
Let's use dark
for the dark mode class as an example.
<script>
import { Accessibility, Activity, Airplay } from 'svlete-lucide';
</script>
<Accessibility class="text-blue-700 dark:text-red-500" />
<Activity class="text-red-700 dark:text-green-500" />
<Airplay class="text-green-500 dark:text-blue-500" />
If you want to make an icon unfocusable, add tabindex="-1"
.
<Airplay tabindex="-1" />
All icons have the following events:
You can pass other attibutes as well.
<Airplay tabindex="0" />
<script>
import { Airplay } from 'svelte-lucide';
</script>
<svelte:component this="{Airplay}" />
Use import * as Icon from 'svelte-lucide
.
<script>
import * as Icon from 'svelte-lucide';
</script>
<h1>Size</h1>
<Icon.Activity size="30" />
<Icon.Activity size="40" />
<Icon.Activity size="50" />
<h1>CSS HEX color</h1>
<Icon.Bike color="#c61515" size="40" />
<h1>Tailwind CSS</h1>
<Icon.Users class="text-blue-500" />
<Icon.Users class="text-pink-700" />
This website can be downloaded and installed on your device for offline access as a Progressive Web App.
To install a PWA, look for the "Add to Home Screen" option in the browser's menu or settings. On most mobile devices, this option can be found by visiting the website, then selecting the "Options" or "Menu" button in the browser, and looking for the "Add to Home Screen" option. On some desktop browsers, right-click on the page and select "Install".
FAQs
1460+ Lucide SVG icon components for Svelte
The npm package svelte-lucide receives a total of 4,616 weekly downloads. As such, svelte-lucide popularity was classified as popular.
We found that svelte-lucide demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
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.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.