Inputs Demo contains a form using a checkbox.
import { Checkbox } from "@taystack/react-ui";
<Checkbox />
Prop | Type | Required | Default |
id | String | true | |
label | String | false | "" |
onChange | Function | false | x => x |
style | Object | false | {} see notes |
id
StringRequired for use with htmlFor, checkbox is drawn with a <label />
.
label
StringIf present, will display a text label for the checkbox. Keep it short.
defaultChecked
StringSets the input value to the String assigned.
Note: Changing this value will modify the value of input.
style
ObjectThis will change the container styles. Useful for margin
.
inputStyle
ObjectThis will change the input styles. Use at your own risk.
error
BooleanShows the input in an error state if true.
errorText
StringUseful for displaying custom error messages for this input when error === true
.