yarn add @twilio-paste/checkbox - or - yarn add @twilio-paste/core
import {Checkbox, CheckboxGroup} from '@twilio-paste/core/checkbox';
const Component = () => (
<CheckboxGroup name="foo" legend="foo">
<Checkbox id="foo" value="foo" name="foo">
Foo
</Checkbox>
</CheckboxGroup>
);
checked
Use on the currently selected checkbox
- Type
boolean
- Default
null
defaultChecked
Only for use with uncontrolled checkboxes
- Type
boolean
- Default
null
element
Overrides the default element name to apply unique styles with the Customization Provider
- Type
any
- Default
CHECKBOX
hasError
- Type
boolean
- Default
null
helpText
- Type
| string | number | boolean | ReactElement<any, string | JSXElementConstructor<any>> | ReactFragment | ReactPortal
- Default
null
id
- Type
string
- Default
unique id
indeterminate
- Type
boolean
- Default
null
isSelectAll
- Type
boolean
- Default
null
isSelectAllChild
- Type
boolean
- Default
null
Inherited props
Paste components will often extend native HTML elements and as a result will inherit or extend their available properties. Below is a list of the props this component has inherited and are also available to use.
name RequiredRequired
- Type
string
- Default
null
element
Overrides the default element name to apply unique styles with the Customization Provider
- Type
any
- Default
CHECKBOX_GROUP
i18nRequiredLabel
Accessible label for the required dot
- Type
string
- Default
(required)
isSelectAll
- Type
boolean
- Default
null
onChange
- Type
(checked: boolean) => void
- Default
null
Inherited props
Paste components will often extend native HTML elements and as a result will inherit or extend their available properties. Below is a list of the props this component has inherited and are also available to use.
checked
Use on the currently selected checkbox
- Type
boolean
- Default
null
defaultChecked
Only for use with uncontrolled checkboxes
- Type
boolean
- Default
null
element
Overrides the default element name to apply unique styles with the Customization Provider
- Type
any
- Default
CHECKBOX_DISCLAIMER
errorText
Sets the Checkbox Group in error state
- Type
| string | number | boolean | ReactElement<any, string | JSXElementConstructor<any>> | ReactFragment | ReactPortal
- Default
null
id
- Type
string
- Default
unique id
Inherited props
Paste components will often extend native HTML elements and as a result will inherit or extend their available properties. Below is a list of the props this component has inherited and are also available to use.