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 switch input element. -
thumb— The position indicator of the switch. -
label— The switch label.
Properties
Section titled "Properties"labelPosition
Section titled "labelPosition"The label position of the control.
labelPosition: ToggleLabelPosition 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 control's checked state changes.
onChange(args: CustomEvent<IgrCheckboxChangeEventArgs>): void