# Switch API

> Auto-generated API reference for `Switch` from @vuetify/v0 (Vuetify0).
> Source of truth: https://0.vuetifyjs.com/api/switch

## Related

- https://0.vuetifyjs.com/components/forms/switch
- https://0.vuetifyjs.com/composables/selection/create-group
- https://0.vuetifyjs.com/components/providers/group

## Switch.Root

### Props

| Name | Type | Default | Required | Description |
|---|---|---|---|---|
| `id` | `any` | `useId()` | no | Unique identifier (auto-generated if not provided) |
| `label` | `string \| undefined` | — | no | Optional display label (passed through to slot) |
| `value` | `V \| undefined` | — | no | Value associated with this switch (used in group mode and form submission) |
| `name` | `string \| undefined` | — | no | Form field name - triggers auto hidden input when provided |
| `form` | `string \| undefined` | — | no | Associate with form by ID |
| `disabled` | `MaybeRefOrGetter<boolean> \| undefined` | `false` | no | Disables this switch |
| `indeterminate` | `MaybeRefOrGetter<boolean> \| undefined` | `false` | no | Sets the indeterminate state |
| `namespace` | `string \| undefined` | `"v0:switch:root"` | no | Namespace for context provision to children (Track, Thumb, HiddenInput) |
| `groupNamespace` | `string \| undefined` | `"v0:switch:group"` | no | Namespace for connecting to parent Switch.Group |
| `ariaLabelledby` | `string \| undefined` | — | no | ID of element that labels this switch |
| `ariaDescribedby` | `string \| undefined` | — | no | ID of element that describes this switch |
| `ariaInvalid` | `boolean \| undefined` | — | no | Whether the switch has an invalid value |
| `modelValue` | `boolean \| undefined` | — | no | — |

### Events

| Name | Type | Description |
|---|---|---|
| `update:model-value` | `[value: boolean]` | — |

### Slots

| Name | Type | Description |
|---|---|---|
| `default` | `SwitchRootSlotProps<V>` | — |

## Switch.Group

### Props

| Name | Type | Default | Required | Description |
|---|---|---|---|---|
| `namespace` | `string \| undefined` | `"v0:switch:group"` | no | Namespace for context provision to children |
| `disabled` | `boolean \| undefined` | `false` | no | Disables all switches in the group |
| `enroll` | `boolean \| undefined` | `false` | no | Auto-select items on registration |
| `mandatory` | `boolean \| "force" \| undefined` | `false` | no | Require at least one switch to be on. `'force'` prevents deselecting the last item |
| `label` | `string \| undefined` | — | no | Accessible group label |
| `ariaLabelledby` | `string \| undefined` | — | no | ID of element that labels this group |
| `ariaDescribedby` | `string \| undefined` | — | no | ID of element that describes this group |
| `modelValue` | `T \| T[] \| undefined` | — | no | — |

### Events

| Name | Type | Description |
|---|---|---|
| `update:model-value` | `[value: T \| T[]]` | — |

### Slots

| Name | Type | Description |
|---|---|---|
| `default` | `SwitchGroupSlotProps` | — |

## Switch.HiddenInput

### Props

| Name | Type | Default | Required | Description |
|---|---|---|---|---|
| `namespace` | `string \| undefined` | `"v0:switch:root"` | no | Namespace for connecting to parent Switch.Root |
| `name` | `string \| undefined` | — | no | Form field name (overrides Root's name) |
| `value` | `string \| undefined` | — | no | Form field value (overrides Root's value, defaults to 'on') |
| `form` | `string \| undefined` | — | no | Associate with form by ID (overrides Root's form) |

## Switch.SelectAll

### Props

| Name | Type | Default | Required | Description |
|---|---|---|---|---|
| `label` | `string \| undefined` | — | no | Accessible label for the select-all toggle |
| `disabled` | `boolean \| undefined` | — | no | Disables this toggle |
| `namespace` | `string \| undefined` | `"v0:switch:root"` | no | Namespace for context provision to children (Track, Thumb) |
| `groupNamespace` | `string \| undefined` | `"v0:switch:group"` | no | Namespace for connecting to parent Switch.Group |
| `ariaLabelledby` | `string \| undefined` | — | no | ID of element that labels this toggle |
| `ariaDescribedby` | `string \| undefined` | — | no | ID of element that describes this toggle |

### Slots

| Name | Type | Description |
|---|---|---|
| `default` | `SwitchSelectAllSlotProps` | — |

## Switch.Thumb

### Props

| Name | Type | Default | Required | Description |
|---|---|---|---|---|
| `namespace` | `string \| undefined` | `"v0:switch:root"` | no | Namespace for connecting to parent Switch.Root |

### Slots

| Name | Type | Description |
|---|---|---|
| `default` | `SwitchThumbSlotProps` | — |

## Switch.Track

### Props

| Name | Type | Default | Required | Description |
|---|---|---|---|---|
| `namespace` | `string \| undefined` | `"v0:switch:root"` | no | Namespace for connecting to parent Switch.Root |

### Slots

| Name | Type | Description |
|---|---|---|
| `default` | `SwitchTrackSlotProps` | — |
