Add documentation for switch thumb slot

This commit is contained in:
Mohammed Helaiwa 2024-10-26 20:23:08 +03:00
parent 93b1807371
commit 03df1771a5

View File

@ -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