Checkbox

Checkbox

import Checkbox from "@kiwicom/orbit-components/lib/Checkbox";
<Checkbox label="Checkbox" />

Props

NameTypeDefaultDescription
ariaControlsstringIdentifies the element whose contents or presence are controlled by the Checkbox.
ariaDescribedbystringIdentifies the element that describes the Checkbox, providing additional information.
checkedbooleanIf true, the Checkbox will be checked.
defaultCheckedbooleanIf true, the Checkbox will be checked by default. Only to be used in uncontrolled.
disabledbooleanfalseIf true, the Checkbox will be set up as disabled.
dataTeststringOptional prop for testing purposes.
idstringSet id for Checkbox
hasErrorbooleanfalseIf true, the border of the Checkbox will turn red. See Functional specs
infoReact.NodeThe additional info about the Checkbox.
labelstringThe label of the Checkbox.
namestringThe name for the Checkbox.
onChangeevent => void \| PromiseFunction for handling onChange event.
reffuncProp for forwarded ref of the Checkbox. See Functional specs
tabIndexstring \| numberSpecifies the tab order of an element
valuestringThe value of the Checkbox.

Functional specs

FakeCheckbox

Props

NameTypeDefaultDescription
checkedbooleanfalseIf true, the FakeCheckbox will be checked.
disabledbooleanfalseIf true, the FakeCheckbox will be set up as disabled.
hasErrorbooleanfalseIf true, the border of the FakeCheckbox will turn red. See Functional specs

Functional specs for FakeCheckbox

  • The hasError prop will be visible only when the FakeCheckbox is not checked nor disabled.

Example

import * as React from "react";
<div role="checkbox" onChange={() => {}}>
<Text>Item title</Text>
<FakeCheckbox checked={selected} disabled={disabled} />
</div>;