Checkboxes
Checkbox props
Name | Type | Default | Description |
---|---|---|---|
label | string | - | The label displayed next to the checkbox. |
name | string | - | The name of field being registered. |
tooltip | string | - | Tooltip content to display additional information about the checkbox. |
isDisabled | boolean | - | Disables the checkbox when true . |
dataTestId | string | '' | A data-testid attribute for testing purposes. |
Checkboxes group props
Name | Type | Default | Description |
---|---|---|---|
fields | Array<TCheckbox> | [] | Array of objects representing the properties for individual checkboxes. |
label | string | - | The label displayed for the component. If component is used as a standalone component, it needs to be wrapped with withLabelAndTooltip . |
labelConfig | object | { labelClassName: {}, labelTextClassName: {} } | Configuration for customizing label styles. If component is used as a standalone component, it needs to be wrapped with withLabelAndTooltip . |
id | string | - | The unique identifier for the component. If component is used as a standalone component, it needs to be wrapped with withLabelAndTooltip . |
tooltip | string | '' | Tooltip content to display additional information. If component is used as a standalone component, it needs to be wrapped with withLabelAndTooltip . |
dependsOnField | object | { fieldName: '', value: [] } | Defines dependencies on another field (To show or hide this component,based on state of some field), specifying the field name and expected value(s). If component is used as a standalone component, it needs to be wrapped with withLabelAndTooltip . |
Example config
const checkboxGroupConfig = {
type: 'checkboxes',
data: {
label: 'Agreements',
fields: [
{
name: 'isAcceptedTermsAndConditions',
label: 'Please accept the terms and conditions'
},
{
name: 'isAcceptedPrivacyPolicy',
label: 'Please accept the privacy policy'
},
{
name: 'isAcceptedMarketing',
label: 'Please accept marketing preferences'
}
]
}
}