Similar to a checkbox, a switch controls the state of a single setting on or off.
- Slots
-
default— The switch label.
- CSS Parts
-
base— The base wrapper of the switch. -
control— The track of the switch. It holds the thumb. -
thumb— The position indicator of the switch. -
label— The switch label. -
checked— Added to the base, control, label and thumb parts when the switch is checked. -
focused— Added to the control part when the switch has keyboard focus.
Properties
Section titled "Properties"labelPosition
Section titled "labelPosition"The label position of the control.
labelPosition: ToggleLabelPosition value
Section titled "value"The value of the control, submitted when the control is checked.
value: string Methods
Section titled "Methods"Removes focus from the control.
blur(): void Returns void
click
Section titled "click"Simulates a click on the control.
click(): void Returns void
focus
Section titled "focus"Sets focus on the control.
focus(options: FocusOptions): void Parameters
- options:
FocusOptions
Returns void
Events
Section titled "Events"onChange
Section titled "onChange"Emitted when the checked state of the control changes by user interaction.
onChange(args: CustomEvent<IgrCheckboxChangeEventArgs>): void