1
0
mirror of https://github.com/tabler/tabler-icons.git synced 2025-08-21 21:25:58 +02:00
This commit is contained in:
codecalm
2023-09-27 20:45:02 +02:00
6 changed files with 57 additions and 7 deletions

View File

@@ -122,7 +122,19 @@ Vue components available through [`@tabler/icons-vue`](https://www.npmjs.com/pac
```vue ```vue
<template> <template>
<!-- basic usage -->
<IconHome /> <IconHome />
<!-- set `stroke` color -->
<IconHome color="red"/>
<IconHome stroke="red"/>
<!-- set custom `width` and `height` -->
<IconHome size="36"/>
<!-- set `stroke-width` -->
<IconHome strokeWidth="2"/>
<IconHome stroke-width="2"/>
</template> </template>
<script> <script>
@@ -135,6 +147,19 @@ export default {
</script> </script>
``` ```
or with `<script setup>`
```vue
<script setup>
// Import Vue component
import { IconHome } from '@tabler/icons-vue';
</script>
<template>
<IconHome color="red" size="36" strokeWidth="2"/>
</template>
```
For more details, see the [documentation](https://github.com/tabler/tabler-icons/tree/master/packages/icons-vue). For more details, see the [documentation](https://github.com/tabler/tabler-icons/tree/master/packages/icons-vue).

View File

@@ -52,7 +52,19 @@ All icons are Vue components that contain SVG elements. So any icon can be impor
```vue ```vue
<template> <template>
<!-- basic usage -->
<IconHome /> <IconHome />
<!-- set `stroke` color -->
<IconHome color="red"/>
<IconHome stroke="red"/>
<!-- set custom `width` and `height` -->
<IconHome size="36"/>
<!-- set `stroke-width` -->
<IconHome strokeWidth="2"/>
<IconHome stroke-width="2"/>
</template> </template>
<script> <script>
@@ -65,10 +77,23 @@ export default {
</script> </script>
``` ```
You can pass additional props to adjust the icon. or with `<script setup>`
```vue
<script setup>
// Import Vue component
import { IconHome } from '@tabler/icons-vue';
</script>
<template>
<IconHome color="red" size="36" strokeWidth="2"/>
</template>
```
You can pass additional attribute `stroke-width="1"` alongside the props to adjust the icon.
```html ```html
<IconHome color="red" :size="48" stroke-width="1" /> <IconHome color="red" size="48" stroke-width="1" />
``` ```
### Props ### Props
@@ -77,7 +102,7 @@ You can pass additional props to adjust the icon.
| ------------- | -------- | ------------ | | ------------- | -------- | ------------ |
| `size` | _Number_ | 24 | | `size` | _Number_ | 24 |
| `color` | _String_ | currentColor | | `color` | _String_ | currentColor |
| `stroke` | _Number_ | 2 | | `strokeWidth` | _Number_ | 2 |
## Contributing ## Contributing

View File

@@ -2,7 +2,7 @@ import { h } from 'vue';
import defaultAttributes from './defaultAttributes'; import defaultAttributes from './defaultAttributes';
const createVueComponent = (iconName, iconNamePascal, iconNode) => ( const createVueComponent = (iconName, iconNamePascal, iconNode) => (
{ size, color, stroke, ...props }, { size, color, strokeWidth, ...props },
{ attrs, slots } { attrs, slots }
) => { ) => {
return h( return h(
@@ -12,7 +12,7 @@ const createVueComponent = (iconName, iconNamePascal, iconNode) => (
width: size || defaultAttributes.width, width: size || defaultAttributes.width,
height: size || defaultAttributes.height, height: size || defaultAttributes.height,
stroke: color || defaultAttributes.stroke, stroke: color || defaultAttributes.stroke,
strokeWidth: stroke || defaultAttributes['stroke-width'], 'stroke-width': strokeWidth || defaultAttributes['stroke-width'],
...attrs, ...attrs,
class: ['tabler-icon', `tabler-icon-${iconName}`, attrs?.class || ''], class: ['tabler-icon', `tabler-icon-${iconName}`, attrs?.class || ''],
...props, ...props,

View File

@@ -1,5 +1,5 @@
--- ---
tags: [warring, error, shape, caution, alert] tags: [warning, error, shape, caution, alert]
unicode: "f634" unicode: "f634"
version: "1.117" version: "1.117"
--- ---

View File

@@ -10649,7 +10649,7 @@
"color-filter": { "color-filter": {
"name": "color-filter", "name": "color-filter",
"category": "Design", "category": "Design",
"tags": ["color", "filter", "hue", "brightness", "effects", "sotring", "tools", "icon", "stroke", "outline"], "tags": ["color", "filter", "hue", "brightness", "effects", "sorting", "tools", "icon", "stroke", "outline", "circles"],
"version": "1.110", "version": "1.110",
"unicode": "f5a8" "unicode": "f5a8"
}, },