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
590+ Lucide-icons for Svelte.
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.
pnpm i -D svelte-lucide
In a svelte file:
<script>
import { Icon } from 'svlete-lucide';
</script>
<Icon name="accessibility" />
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 width
and height
props to change the size of icons.
<Icon name="accessibility" width="100" height="100" />
If you are using Tailwind CSS, you can add a custom size using Tailwind CSS by including the desired classes in the class prop. For example:
<Icon name="accessibility" class="shrink-0 h-20 w-20" />
Use the color
prop to change colors with HEX color code.
<Icon name="accessibility" color="#c61515" />
You can apply CSS framework color and other attributes directly to the icon component or its parent tag using the class
prop.
Tailwind CSS example:
<Icon name="accessibility" class="text-red-700 inline m-1" />
Bootstrap examples:
<Icon name="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.
<Icon name="accessibility" class="text-blue-700 dark:text-red-500" />
All icons have aria-label. For example accessibility
has aria-label="accessibility"
.
Use ariaLabel
prop to modify the aria-label
value.
<Icon name="accessibility" ariaLabel="red accessibility" color="#c61515"/>
If you want to make an icon unfocusable, add tabindex="-1"
.
<Icon name="accessibility" tabindex="-1" />
All icons have the following events:
You can pass other attibutes as well.
<Icon name="accessibility" tabindex="0" />
<svelte:component this="{Icon}" name="accessibility" />
<script>
import {Icon} from 'svelte-evil-icons';
import { onMount } from 'svelte';
const props = {
name: 'accessibility',
size: '50',
color: '#ff0000'
};
onMount(() => {
const icon = new Icon({ target: document.body, props });
});
</script>
Use import {Icon, icons} from 'svelte-evil-icons';
.
<script>
import {Icon, icons} from 'svelte-evil-icons';
</script>
{#each Object.keys(icons) as name}
<div class="flex gap-4 items-center text-lg">
<Icon name={name} bind:width={size} bind:height={size} class="shrink-0"/>
{name}
</div>
{/each}
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.