mirror of
https://github.com/tabler/tabler.git
synced 2026-10-12 21:27:06 +04:00
46 lines
1.2 KiB
Plaintext
46 lines
1.2 KiB
Plaintext
---
|
|
title: Preact
|
|
description: Add Tabler Icons to Preact apps with the official tree-shakable package. Import any of over 5000 lightweight SVG icons as components.
|
|
summary: The official Preact package for Tabler Icons. Every icon is a tree-shakable component with size, color and stroke props.
|
|
---
|
|
|
|
import TabsPackage from '@components/TabsPackage.astro'
|
|
|
|

|
|
|
|
## Installation
|
|
|
|
<TabsPackage name="@tabler/icons-preact" />
|
|
|
|
or just [download from Github](https://github.com/tabler/tabler-icons/releases).
|
|
|
|
## How to use
|
|
|
|
It's built with ESmodules so it's completely tree-shakable. Each icon can be imported as a component.
|
|
|
|
```js
|
|
import { IconArrowDown } from '@tabler/icons-preact';
|
|
|
|
const App = () => {
|
|
return <IconArrowDown />;
|
|
};
|
|
|
|
export default App;
|
|
```
|
|
|
|
You can pass additional props to adjust the icon.
|
|
|
|
```js
|
|
<IconArrowDown color="red" size={48} />
|
|
```
|
|
|
|
### 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 |
|