@kiwicom/orbit-components
Version:
<div align="center"> <a href="https://orbit.kiwi" target="_blank"> <img alt="orbit-components" src="https://orbit.kiwi/wp-content/uploads/2018/08/orbit-components.png" srcset="https://orbit.kiwi/wp-content/uploads/2018/08/orbit-components@2x.png 2x"
26 lines (23 loc) • 1.34 kB
Markdown
# Checkbox
To implement Checkbox component into your project you'll need to add the import:
```jsx
import Checkbox from "@kiwicom/orbit-components/lib/Checkbox";
```
After adding import into your project you can use it simply like:
```jsx
<Checkbox label="Checkbox"/>
```
## Props
Table below contains all types of the props available in Checkbox component.
| Name | Type | Default | Description |
| :------- | :----------- | :------ | :------------------------------- |
| checked | `boolean` | `false` | If `true`, the Checkbox will be checked.
| disabled | `boolean` | `false` | If `true`, the Checkbox will be set up as disabled.
| dataTest | `string` | | Optional prop for testing purposes.
| hasError | `boolean` | `false` | If `true`, the border of the Checkbox will turn red. [See Functional specs](#functional-specs)
| info | `React.Node` | | The additional info about the Checkbox.
| **label** | `string` | | The label of the Checkbox.
| onChange | `func` | | Function for handling onChange event.
| value | `string` | | The value of the Checkbox.
## Functional specs
* The `hasError` prop will be visible only when the Checkbox has `checked` or `disabled` prop set on **false**.