Skip to main content

Checkboxes

Checkbox props

NameTypeDefaultDescription
labelstring-The label displayed next to the checkbox.
namestring-The name of field being registered.
tooltipstring-Tooltip content to display additional information about the checkbox.
isDisabledboolean-Disables the checkbox when true.
dataTestIdstring''A data-testid attribute for testing purposes.

Checkboxes group props

NameTypeDefaultDescription
fieldsArray<TCheckbox>[]Array of objects representing the properties for individual checkboxes.
labelstring-The label displayed for the component. If component is used as a standalone component, it needs to be wrapped with withLabelAndTooltip.
labelConfigobject{ labelClassName: {}, labelTextClassName: {} }Configuration for customizing label styles. If component is used as a standalone component, it needs to be wrapped with withLabelAndTooltip.
idstring-The unique identifier for the component. If component is used as a standalone component, it needs to be wrapped with withLabelAndTooltip.
tooltipstring''Tooltip content to display additional information. If component is used as a standalone component, it needs to be wrapped with withLabelAndTooltip.
dependsOnFieldobject{ 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'
}
]
}
}