Switch

Offers a control to toggle a setting on or off.

Switch

To implement Switch component into your project you’ll need to add the import:

import Switch from "@kiwicom/orbit-components/lib/Switch";

After adding import into your project you can use it simply like:

<Switch checked={isChecked} onChange={handleOnChange} />

Props

Table below contains all types of the props available in StopoverArrow component.

NameTypeDefaultDescription
dataTeststringOptional prop for testing purposes.
onChange() => void \| PromiseFunction for handling onChange event.
onFocus() => void \| PromiseFunction for handling onFocus event.
onBlur() => void \| PromiseFunction for handling onBlur event.
checkedbooleanIf true, the Switch will be checked.
ariaLabelledbystringOptional prop for a11y element
iconReact.Node<Circle />Optional property for custom icon.
disabledbooleanfalseIf true, the Switch will be disabled.