SelectableBox
A box that has selection states. It can be used as an alternative to a radio button or checkbox set.
The SelectableBox can contain any kind of content as long as it is not clickable. In other words, there should be no clickable targets distinct from selection.
Basic Usage
As Checkbox
Any Paragon component or export may be added to the code example.
As Radio
Any Paragon component or export may be added to the code example.
As Checkbox
As Checkbox with isIndeterminate
Any Paragon component or export may be added to the code example.
As Checkbox with ariaLabelledby
Any Paragon component or export may be added to the code example.
Without active outline
The showActiveBoxState property only affects SelectableBox that have inputHidden set to false.
If a component has no input, the border is always rendered in an active state.
Any Paragon component or export may be added to the code example.
Theme Variables#
| CSS Variable | Computed Value |
|---|---|
| | |
| | |
| | |
| | |
| | |
Props API#
- children
nodeRequiredContent of the
SelectableBox. - value
string|numberA value that is passed to the input tag.
- checked
boolDefaultfalseControls whether
SelectableBoxis checked. - type
enum'radio' | 'checkbox'Default'radio'Indicates the input type: checkbox or radio.
- onClick
funcDefault() => {}Function that is called when the
SelectableBoxis clicked. - onFocus
funcDefault() => {}Function that is called when the
SelectableBoxis focused. - inputHidden
boolDefaulttrueControls display of the input (checkbox or radio button) on the
SelectableBox. - isIndeterminate
boolDefaultfalseIndicates a state for the 'checkbox'
typewhenSelectableBoxis neither checked nor unchecked. - isInvalid
boolDefaultfalseAdds errors styles to the
SelectableBox. - className
stringA class that is appended to the base element.
- showActiveBoxState
boolDefaulttrueControls the visibility of the active state for the
SelectableBox.
Usage Insights#
SelectableBox
| Project Name | Paragon Version | Instance Count | |
|---|---|---|---|
| frontend-app-course-authoring | 21.5.6 | 11 | |
| frontend-app-enterprise-public-catalog | 20.46.3 | 3 | |
| frontend-app-learner-portal-enterprise | 20.45.4 | 1 | |
| frontend-app-learner-record | 20.46.3 | 1 | |
| frontend-app-library-authoring | 21.5.6 | 3 | |
| frontend-lib-content-components | 21.5.6 | 2 |
SelectableBoxSet
| Project Name | Paragon Version | Instance Count | |
|---|---|---|---|
| frontend-app-course-authoring | 21.5.6 | 4 | |
| frontend-app-enterprise-public-catalog | 20.46.3 | 1 | |
| frontend-app-learner-portal-enterprise | 20.45.4 | 1 | |
| frontend-app-learner-record | 20.46.3 | 1 | |
| frontend-app-library-authoring | 21.5.6 | 1 | |
| frontend-lib-content-components | 21.5.6 | 2 |