Checkbox form element.
npm install @crave/farmblocks-input-checkboxInput elements that behaves like a toggle:
- Checkbox
- Switch
```
npm install @crave/farmblocks-input-checkbox
`javascript
import React, { Component } from "react";
import { render } from "react-dom";
import { Checkbox, Switch } from "@crave/farmblocks-input-checkbox";
const root = document.createElement("div");
document.body.appendChild(root);
render(
See the stories source code for more usage examples.
Properties
The core of the Checkbox and Switch components is an html
input element of
type type="checkbox". So the APIs are very similar.This component also accepts the properties
disabled and tooltipText` from theIn addition to the properties described above, there are some other optional
properties:
| property | type | description |
| -------- | -------- | ------------------------------------------------- |
| label | string | a text to be used as label for the checkbox field |
| innerRef | function | ref function passed to the component |
MIT