1970+ SVG Tabler Icons components for Svelte. Svelte-Tabler support major CSS frameworks using the class
props.
npm i -D svelte-tabler
In a svelte file:
<script>
import { Folders, GitMerge } from 'svelte-tabler';
</script>
<Folders />
<GitMerge />
Use the size
prop to change the size of icons.
<Folders size="40" /> <GitMerge size="40" />
Use the color
prop to change colors with HEX color code.
<Folders color="#c61515" /> <GitMerge color="#3759e5" />
Use the class
prop to change size, colors and add additional css.
Tailwind CSS example:
<Folders class="h-24 w-24 text-blue-700 mr-4" />
Bootstrap examples:
<Folders 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.
<Folders class="text-blue-700 dark:text-red-500" />
All icons have aria-label. For example FolderMinus
has aria-label="folder minux"
.
Use ariaLabel
prop to modify the aria-label
value.
<FolderMinus ariaLabel="folder minux svg icon" />
You can pass other attibutes as well.
<FolderMinus tabindex="0" />
<script>
import { FolderMinus } from 'svelte-tabler';
</script>
<svelte:component this="{FolderMinus}" />
<script>
import { FolderMinus } from 'svelte-tabler';
import { onMount } from 'svelte';
const props = {
size: '50',
color: '#ff0000'
};
onMount(() => {
const icon = new FolderMinus({ target: document.body, props });
});
</script>
Use import * as Icon from 'svelte-tabler
.
<script>
import * as Icon from 'svelte-tabler';
</script>
<Icon.FolderMinus />
<Icon.GitMerge />
<h1>Size</h1>
<Icon.FolderMinus size="30" />
<Icon.GitMerge size="40" />
<h1>CSS HEX color</h1>
<Icon.GitMerge color="#c61515" size="40" />
<h1>Tailwind CSS</h1>
<Icon.FolderMinus class="text-blue-500" />
<Icon.GitMerge class="text-pink-700" />