Checkbox
Checkbox control for selection lists, permissions, and partial multi-select state.
Overview
Checkbox is the shared checkbox control used across the platform for:
DataTableselection- row selection
- permission toggles
- multi-select lists
- partial or indeterminate selection state
It wraps CheckboxPrimitive and adds optional label support.
DataTable Selection Pattern
One of the most important Checkbox patterns in the system is DataTable selection.
The same control is used for:
- top-level select-all
- group-level select-all
- individual row selection
- disabled placeholder cells in skeleton and non-interactive states
<Checkbox
checked={isTopLevelChecked}
onChange={handleTopLevelCheckboxClick}
/>In practice, this is one of the clearest reference implementations for how Checkbox behaves across list-heavy dashboard UI.
Basic Usage
<Checkbox
label="Allow attendees to invite others"
checked={value}
onChange={onChange}
/>Partial Checked State
Use partialChecked for select-all controls when some, but not all, child items are selected.
<Checkbox
partialChecked={selectedConversationIds.length > 0}
checked={conversations.every((c) => selectedConversationIds.includes(c.id))}
onChange={handleToggleAll}
/>This is the pattern used in ChatOverview.tsx.
Inside Clickable Rows
By default, the checkbox prevents click propagation. Use allowPropagation only when the parent row also needs the event.
<Checkbox
checked={isSelected}
onChange={onSelectionChange}
allowPropagation
/>Props
| Prop | Type | Default | Description |
|---|---|---|---|
checked | boolean | — | Whether the checkbox is checked. |
partialChecked | boolean | — | Shows the indeterminate-style partial state. |
onChange | (checked: boolean) => void | — | Called when the checkbox changes. |
className | string | — | Additional classes passed to the primitive. |
disabled | boolean | — | Disables interaction. |
label | string | — | Optional label text. |
allowPropagation | boolean | false | Allows click events to bubble to a clickable parent. |
size | 'md' | 'sm' | 'md' | Checkbox size. |
Checkbox Primitive
CheckboxPrimitive is the low-level control used internally by Checkbox.
Use it directly only when you need a custom row or card layout without the standard label wrapper. In normal product code, prefer Checkbox.
Brand Dashboard Usage
| Pattern | Path | Notes |
|---|---|---|
| Shared DataTable header selection | fsai/packages/shared-ui/src/components/DataTable/table/DataTableTableView.tsx | Canonical select-all checkbox usage in the shared table system. |
| Shared DataTable row selection | fsai/packages/shared-ui/src/components/DataTable/table/DataTableItems.tsx | Canonical row-level selection and disabled placeholder usage. |
| Shared DataTable group selection | fsai/packages/shared-ui/src/components/DataTable/group/DataTableGroup.tsx | Group-level checkbox selection in grouped table views. |
| Table or list select-all | fsai/apps/brand-dashboard/src/pages/Home/ChatOverview/ChatOverview.tsx | Uses partialChecked for mixed selection state. |
| Dense row selection | fsai/apps/brand-dashboard/src/pages/Territories/DealZonesSidebar.tsx | Checkbox used inside clickable list rows. |
| Field-style permissions | fsai/apps/brand-dashboard/src/pages/Home/Calendar/CalendarEventInformation/CalendarEventForm.tsx | Multiple independent permission toggles. |
| Multi-select file-type filters | fsai/apps/brand-dashboard/src/pages/PortalEditor/ApplicantPortalEditor/PortalStepUpsert/components/ActionFieldsSwitcher/UploadActionField.tsx | Checkbox list for multiple selected values. |
Choosing Between Checkbox, Toggle, And Radio
- Use
Checkboxfor membership in a set or multiple independent true/false options. - Use
Togglefor a single on/off setting. - Use
Radiowhen only one option may be chosen.
Guidelines
- Do use
partialCheckedfor select-all or hierarchical selection UI - Do look at
DataTablefirst when you need a canonical checkbox selection pattern - Do use
allowPropagationonly when the checkbox lives inside another clickable surface - Do prefer
CheckboxoverTogglefor multi-select lists - Don't use
Checkboxwhen the interaction is really a mutually exclusive choice