Add documentation for switch thumb slot
This commit is contained in:
parent
93b1807371
commit
03df1771a5
|
|
@ -48,6 +48,19 @@ import { Switch } from '@/components/ui/switch'
|
||||||
</template>
|
</template>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
# Add icon inside switch thumb
|
||||||
|
|
||||||
|
```vue
|
||||||
|
<template>
|
||||||
|
<Switch :checked="isDark" @update:checked="toggleTheme">
|
||||||
|
<template #thumb>
|
||||||
|
<Icon v-if="isDark" icon="lucide:moon" class="size-3"></Icon>
|
||||||
|
<Icon v-else icon="lucide:sun" class="size-3"></Icon>
|
||||||
|
</template>
|
||||||
|
</Switch>
|
||||||
|
</template>
|
||||||
|
```
|
||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
### Form
|
### Form
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user