Checkbox
The Checkbox allows the user to toggle/select multiple values between checked and not checked.
Import
Importimport { Checkbox, CheckboxGroup } from '@backyard-ui/core';Usage
UsageSize
SizeStates
StatesDisabled
DisabledInvalid
InvalidReadOnly
ReadOnlyIndeterminate
IndeterminateControlled
ControlledGroup
GroupControlled
ControlledUsing with FormControl
Using with FormControlTo add a label or status message to your fields use the FormControl utility.
API Reference
API ReferenceCheckbox
Checkbox- sizeDescription The Checkbox sizeType
"xs" | "sm"Defaultsm - valueDescription The Checkbox valueType
string | number - isCheckedDescription If `true`, the checkbox will be checked. You'll need to pass `onChange` to update its value (since it is now controlled)Type
boolean - isIndeterminateDescription If `true`, the checkbox will be indeterminate.Type
boolean - isDisabledDescription Set the form element to disabledType
boolean - isInvalidDescription Set the form element `aria-invalid` to `true`Type
boolean - isReadOnlyDescription Set the form element to readonlyType
boolean - isRequiredDescription Set the form element `aria-required` to `true`Type
boolean 
CheckboxGroup
CheckboxGroup- valueDescription The value of selected checkboxesType
string[] - defaultValueDescription The initial valueType
string[] - onChangeDescription The callback fired when any children Checkbox is checked or uncheckedType
((value: string[]) => void) - children requiredDescription The children nodesType
ReactNode - sizeDescription The Checkbox sizeType
"xs" | "sm"Defaultsm