---
url: "https://vueda.dev/v3/reference/api/vue/Switch.md"
title: "Switch"
---

# Switch

## Overview

A toggle switch built on Reka UI's SwitchRoot, with a sliding thumb indicator.

Theme entry: [Switch](/v3/reference/theming/keys/Switch.md)

## Props

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| <span id="prop-themeOverride">themeOverride</span> | `Object` |  | `null` | A partial ThemeObject keyed by component name, merged over this component's theme and provided to descendants. |
| <span id="prop-class">class</span> | `string\|array\|object` |  | `undefined` | Additional CSS classes to apply to the switch root. |
| <span id="prop-defaultValue">defaultValue</span> | `boolean` |  | `undefined` | The default checked state when uncontrolled. |
| <span id="prop-modelValue">modelValue</span> | `boolean` |  | `undefined` | The controlled checked state (used with v-model). |
| <span id="prop-disabled">disabled</span> | `boolean` |  | `undefined` | Whether the switch is disabled. |
| <span id="prop-id">id</span> | `string` |  | `undefined` | The id applied to the underlying input element. |
| <span id="prop-value">value</span> | `string` |  | `undefined` | The value submitted with a form when checked. |
| <span id="prop-trueValue">trueValue</span> | `boolean\|string` |  | `undefined` | The value representing the checked state. |
| <span id="prop-falseValue">falseValue</span> | `boolean\|string` |  | `undefined` | The value representing the unchecked state. |
| <span id="prop-as">as</span> | `string\|object` |  | `undefined` | The element or component to render as. |
| <span id="prop-asChild">asChild</span> | `boolean` |  | `false` | When true, merges props onto the child element instead of rendering a wrapper. |
| <span id="prop-name">name</span> | `string` |  | `undefined` | The name submitted with a form. |
| <span id="prop-required">required</span> | `boolean` |  | `undefined` | Whether the field is required. |

## Slots

### `thumb` {#slot-thumb}

Scoped slot.

## Events

| Name | Description |
| --- | --- |
| `update:modelValue` | Emitted when the value changes. |

[Full event reference](/v3/reference/api/vue/Switch/events.md)

## Source

`client/lib/controls/switch/Switch.vue`
