Switch

Switch

import Switch from "@kiwicom/orbit-components/lib/Switch";
<Switch checked={isChecked} onChange={handleOnChange} />

Props

NameTypeDefaultDescription
dataTeststringOptional prop for testing purposes.
idstringSet id for Switch input
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.