Switch API
API reference for the Switch components.
Related
Explore these related pages for additional context and usage patterns.
| Page | Category |
|---|---|
| Switch | Forms |
| createGroup | Selection |
| Group | Providers |
Switch.Root
Props
namespace
string | undefinedNamespace for context provision to children (Track, Thumb, HiddenInput)
Default: "v0:switch:root"
groupNamespace
string | undefinedNamespace for connecting to parent Switch.Group
Default: "v0:switch:group"
modelValue
boolean | undefinedEvents
update:model-value
[value: boolean]Slots
default
SwitchRootSlotProps<V>Switch.Group
Props
mandatory
boolean | "force" | undefinedRequire at least one switch to be on. `'force'` prevents deselecting the last item
Default: false
modelValue
T | T[] | undefinedEvents
update:model-value
[value: T | T[]]Slots
default
SwitchGroupSlotPropsSwitch.HiddenInput
Props
Switch.SelectAll
Props
namespace
string | undefinedNamespace for context provision to children (Track, Thumb)
Default: "v0:switch:root"
groupNamespace
string | undefinedNamespace for connecting to parent Switch.Group
Default: "v0:switch:group"
Slots
default
SwitchSelectAllSlotPropsSwitch.Thumb
Props
Slots
default
SwitchThumbSlotPropsSwitch.Track
Props
Slots
default
SwitchTrackSlotProps