Skip to main content
You are viewing Pre-Alpha documentation.
Vuetify0 Logo
Theme
Mode
Accessibility
Vuetify
Vuetify One

Sign in to Vuetify One

Access premium tools across the Vuetify ecosystem — Bin, Play, Studio, and more.

Not a subscriber? See what's included

Switch API

API reference for the Switch components.

Switch.Root

Props

id

ID

Unique identifier (auto-generated if not provided)

Default: useId()

label

string

Optional display label (passed through to slot)

value

V

Value associated with this switch (used in group mode and form submission)

name

string

Form field name - triggers auto hidden input when provided

form

string

Associate with form by ID

disabled

MaybeRef<boolean>

Disables this switch

Default: false

indeterminate

MaybeRef<boolean>

Sets the indeterminate state

Default: false

namespace

string

Namespace for context provision to children (Track, Thumb, HiddenInput)

Default: "v0:switch:root"

groupNamespace

string

Namespace for connecting to parent Switch.Group

Default: "v0:switch:group"

ariaLabelledby

string

ID of element that labels this switch

ariaDescribedby

string

ID of element that describes this switch

ariaInvalid

boolean

Whether the switch has an invalid value

modelValue

boolean

Events

update:model-value

[value: boolean]

Slots

default

SwitchRootSlotProps<V>

Switch.Group

Props

namespace

string

Namespace for context provision to children

Default: "v0:switch:group"

disabled

boolean

Disables all switches in the group

Default: false

enroll

boolean

Auto-select items on registration

Default: false

mandatory

boolean | "force"

Require at least one switch to be on. `'force'` prevents deselecting the last item

Default: false

label

string

Accessible group label

ariaLabelledby

string

ID of element that labels this group

ariaDescribedby

string

ID of element that describes this group

modelValue

T | T[]

Events

update:model-value

[value: T | T[]]

Slots

default

SwitchGroupSlotProps

Switch.HiddenInput

Props

value

string

Form field value (overrides Root's value, defaults to 'on')

name

string

Form field name (overrides Root's name)

namespace

string

Namespace for connecting to parent Switch.Root

Default: "v0:switch:root"

form

string

Associate with form by ID (overrides Root's form)

Switch.SelectAll

Props

label

string

Accessible label for the select-all toggle

disabled

boolean

Disables this toggle

namespace

string

Namespace for context provision to children (Track, Thumb)

groupNamespace

string

Namespace for connecting to parent Switch.Group

ariaLabelledby

string

ID of element that labels this toggle

ariaDescribedby

string

ID of element that describes this toggle

Slots

default

SwitchSelectAllSlotProps

Switch.Thumb

Props

namespace

string

Namespace for connecting to parent Switch.Root

Default: "v0:switch:root"

Slots

default

SwitchThumbSlotProps

Switch.Track

Props

namespace

string

Namespace for connecting to parent Switch.Root

Default: "v0:switch:root"

Slots

default

SwitchTrackSlotProps
Was this page helpful?

© 2016-1970 Vuetify, LLC
Ctrl+/