| defaultValue | boolean | — | |
- Name
- defaultValue
- Description
The state of the switch when it is initially rendered. Use when you do not need to control its state. - Type
boolean- Default
- —
|
| modelValue | boolean | null | — | |
- Name
- modelValue
- Description
The controlled state of the switch. Can be bind as v-model. - Type
null | boolean- Default
- —
|
| disabled | boolean | false | |
- Name
- disabled
- Description
When true, prevents the user from interacting with the switch. - Type
boolean- Default
- false
|
| id | string | — | |
- Name
- id
- Description
The element's id, so a <label for> can name it. - Type
string- Default
- —
|
| value | string | 'on' | |
- Name
- value
- Description
The value given as data when submitted with a name. - Type
string- Default
- 'on'
|
| trueValue | boolean | — | |
- Name
- trueValue
- Description
The value used when the switch is on. Defaults to true. - Type
boolean- Default
- —
|
| falseValue | boolean | — | |
- Name
- falseValue
- Description
The value used when the switch is off. Defaults to false. - Type
boolean- Default
- —
|
| asChild | boolean | false | |
- Name
- asChild
- Description
Change the default rendered element for the one passed as a child, merging their props and behavior. Read our Composition guide for more details. - Type
boolean- Default
- false
|
| as | AsTag | Component | 'button' | |
- Name
- as
- Description
The element or component this component should render as. Can be overwritten by asChild. - Type
ComponentOptions<any, any, any, ComputedOptions, MethodOptions, any, any, any, string, {}, {}, string, {}, {}, {}, string, ComponentProvideOptions> | (props: any, ctx: Omit<{ attrs: Attrs; slots: Readonly<InternalSlots>; emit: (event: string, ...args: any[]) => void; expose: <Exposed extends Record<string, any> = Record<string, any>>(exposed?: Exposed | undefined) => void; }, 'expose'>): any | ComponentPublicInstanceConstructor<any, any, any, any, ComputedOptions, MethodOptions> | 'a' | 'button' | 'div' | 'form' | 'h2' | 'h3' | 'img' | 'input' | 'label' | 'li' | 'nav' | 'ol' | 'p' | 'span' | 'svg' | 'ul' | 'template' | {} & string- Default
- 'button'
|
| name | string | — | |
- Name
- name
- Description
The name of the field. Submitted with its owning form as part of a name/value pair. - Type
string- Default
- —
|
| required | boolean | false | |
- Name
- required
- Description
When true, indicates that the user must set the value before the owning form can be submitted. - Type
boolean- Default
- false
|
| class | ClassValue | — | |
- Name
- class
- Description
Classes added to the part's own element, after its recipe classes. - Type
null | string | false | Record<string, any> | ClassValue[]- Default
- —
|
| size | 'md' | 'sm' | 'md' | |
- Name
- size
- Description
The size of the track and thumb. - Type
'md' | 'sm'- Default
- 'md'
|