Checked: false
Checked: false
Color
Use the Tailwind data attribute syntax to target the state using data-[state=checked]
List
Use the Label component to create a list layout.
Icons
Add icons to act as state indicators.
Direction
Set the text direction (ltr or rtl) using the dir prop.
Anatomy
Here’s an overview of how the Switch component is structured in code:
import { Switch } from '@skeletonlabs/skeleton-react';
export default function Anatomy() {
return (
<Switch>
<Switch.Control>
<Switch.Thumb />
</Switch.Control>
<Switch.Label />
<Switch.HiddenInput />
</Switch>
);
}<script lang="ts">
import { Switch } from '@skeletonlabs/skeleton-svelte';
</script>
<Switch>
<Switch.Control>
<Switch.Thumb />
</Switch.Control>
<Switch.Label />
<Switch.HiddenInput />
</Switch>API Reference
Unable to load component information for react/switch
Unable to load component information for svelte/switch