Update switch.md
Add documentation for thumb named slot
This commit is contained in:
parent
e63d5553e3
commit
06f8a2f3da
|
|
@ -47,6 +47,18 @@ import { Switch } from '@/components/ui/switch'
|
|||
<Switch />
|
||||
</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
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user