Switch
The Switch is an interactive, binary component designed for your applications. It offers a clear, visual interface for users to enable or disable specific settings, features, or functionalities.
The Switch is an interactive, binary component designed for your applications. It offers a clear, visual interface for users to enable or disable specific settings, features, or functionalities.
API reference docs for the component. Learn about the props, CSS, and other APIs of this exported module.
boolean
Whether the switch is checked.
boolean
'ltr' | 'rtl'
The document's text/writing direction.
boolean
Whether the switch is disabled.
string
The id of the form that the switch belongs to
() => ShadowRoot | Node | Document
A root node to correctly resolve document in custom environments. E.x.: Iframes, Electron.
string
The unique identifier of the machine.
Partial<{ root: string input: string control: string label: string thumb: string }>
The ids of the elements in the switch. Useful for composition.
boolean
If `true`, the switch is marked as invalid.
string
Specifies the localized strings that identifies the accessibility elements and their states
string
The name of the input field in a switch (Useful for form submission).
(details: CheckedChangeDetails) => void
Function to call when the switch is clicked.
boolean
If `true`, the switch will be readonly
boolean
If `true`, the switch input is marked as required,
string | number
The value of switch input. Useful for form submission.
Dict<any>
Dict<any>
boolean
Whether the checkbox is checked
Dict<any>
Dict<any>
(checked: boolean) => void
Function to set the checked state of the switch.
Dict<any>
() => void
Function to toggle the checked state of the checkbox
boolean
Whether the checkbox is disabled
boolean
Whether the checkbox is focused