Update switch.md

Add documentation for thumb named slot
This commit is contained in:
Mohammed Essam Helewa 2024-10-16 20:28:44 +03:00 committed by GitHub
parent e63d5553e3
commit 06f8a2f3da
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -47,6 +47,18 @@ import { Switch } from '@/components/ui/switch'
<Switch /> <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