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.

Whether the control is checked.

checked: boolean

The label position of the control.

labelPosition: ToggleLabelPosition

The value of the control, submitted when the control is checked.

value: string

Removes focus from the control.

blur(): void

Returns void

Simulates a click on the control.

click(): void

Returns void

Sets focus on the control.

focus(options: FocusOptions): void

Parameters

  • options: FocusOptions

Returns void

Emitted when the checked state of the control changes by user interaction.

onChange(args: CustomEvent<IgrCheckboxChangeEventArgs>): void

Parameters

Returns void