Files
tabler/docs/content/icons/libraries/svelte.mdx

47 lines
1.3 KiB
Plaintext

---
title: Svelte
description: Add Tabler Icons to Svelte apps with the official tree-shakable package. Import over 5000 clean SVG icons as customizable components.
summary: The official Svelte package for Tabler Icons. Every icon is a component with size, color and stroke props.
---
import TabsPackage from '@components/TabsPackage.astro'
![Tabler Icons for Svelte](/img/icons/package-svelte.png)
## Installation
<TabsPackage name="@tabler/icons-svelte" />
or just [download from Github](https://github.com/tabler/tabler-icons/releases).
## How to use
Each icon is a component, and the package ships as ES modules, so only the icons you import end up in the bundle.
```html
<script lang="ts">
import { IconHeart } from "@tabler/icons-svelte";
</script>
<main>
<IconHeart />
</main>
```
You can pass additional props to adjust the icon.
```html
<IconHeart size="{48}" stroke="{1}" />
```
### Props
All icon components accept these props to control the size, color, and stroke width of the rendered SVG:
| name | type | default |
| ------------- | -------- | ------------ |
| `size` | _Number_ | 24 |
| `color` | _String_ | currentColor |
| `stroke` | _Number_ | 2 |
| `class` | _String_ | |