EXEPERTAI LAB

Research alpha

Time Machine
EXEPERTAI LAB
GALLERY / COLLECTION
← Browse Astryx gallery
Checkbox·component·@astryxdesign/core

Checkbox List

Checkbox group container with field integration for label, description, and status.

Open in Playground @astryxdesign/core/CheckboxList

Showcases and examples

3 documented examples

Checkbox List

CheckboxList API entry

Preview loads on approachPreview loads on approach
Exact source · checkbox-list-showcase
// Copyright (c) Meta Platforms, Inc. and affiliates.

'use client';

import {useState} from 'react';
import {CheckboxList, CheckboxListItem} from '@astryxdesign/core/CheckboxList';
export default function CheckboxListShowcase() {
  const [value, setValue] = useState<string[]>(['email']);
  return (
    <CheckboxList
      label="Notification preferences"
      description="Choose how you would like to be notified"
      value={value}
      onChange={setValue}
      hasDividers>
      <CheckboxListItem
        label="Email"
        value="email"
        description="Weekly digest every Monday"
      />
      <CheckboxListItem
        label="Push notification"
        value="push"
        description="Instant alerts on your device"
      />
      <CheckboxListItem
        label="SMS"
        value="sms"
        description="Standard messaging rates apply"
      />
    </CheckboxList>
  );
}

Usage

CheckboxList shows a small group of checkboxes so users can turn several options on or off at once. Place it in settings pages, filter panels, or forms where every choice should be visible without scrolling. For a single standalone checkbox (like "I agree to the terms"), use CheckboxInput instead. If only one option can be picked, use RadioList. If the list is long enough to need searching or scrolling, use MultiSelector instead.

  • Keep the list short: three to seven options is the sweet spot. Beyond that, switch to MultiSelector which adds search and scrolling.
  • Turn on dividers (hasDividers) when items have helper text underneath; without them the labels and descriptions blur together.
  • Write a group label that says what the choices represent: "Export formats" tells users more than "Options".
  • Show a CheckboxList when the user can only pick one thing; that is what RadioList is for.
  • Put buttons or links inside the trailing slot (endContent); the whole row is already tappable, so a nested button creates two competing click targets.
  • Wrap a disabled CheckboxList in Tooltip to explain why it is disabled; disabled controls swallow the hover events the wrapper needs. Use the disabledMessage prop instead.

Typed props

PropType and behavior
labelstring · required
Label text for the checkbox group (always rendered for accessibility).
childrenReactNode · required
valuestring[]
The currently selected values (collection mode).
onChange(values: string[]) => void
Callback fired when the selected values change.
changeAction(values: string[]) => void | Promise<void>
Async action on change with optimistic updates. While the promise is pending, the toggled item shows a spinner inside its checkbox and is marked aria-busy.
isLabelHiddenboolean · default false
Whether to visually hide the label.
descriptionstring
Description text displayed below the label.
density'compact' | 'balanced' | 'spacious' · default 'balanced'
Spacing density for list items.
hasDividersboolean · default false
Whether to show dividers between items.
isDisabledboolean · default false
Whether all checkbox items are disabled.
disabledMessagestring
Explains why the group is disabled. Applies to the whole-group disabled state (isDisabled), not per item. With isDisabled, shows a tooltip on hover/keyboard focus and keeps the checkboxes focusable via aria-disabled (toggling stays blocked). Use this instead of wrapping a disabled CheckboxList in Tooltip. Disabled controls swallow the hover events an external Tooltip needs.
status{type: 'warning' | 'error' | 'success', message?: string}
Status indicator ({ type, message }).
widthSizeValue
Width of the field (number = pixels, string used as-is, e.g. "100%"). Sizes the whole field (label, control, and status) so they stay aligned.
xstyleStyleXStyles
StyleX styles for layout customization. Must be a stylex.create() value.

Anatomy

Group · required

Container for the labeled checkbox group.

Group label · required

Text identifying what the checkbox options represent.

Description · optional

Helper text below the group label.

Options list · required

List containing the available checkbox options.

Option row · required

Selectable row containing one option.

Checkbox · required

Selection indicator for an option.

Option label · required

Primary content identifying an option.

Option description · optional

Secondary text below an option label.

End content · optional

Caller-provided content at the end of an option row.

Spinner · optional

Loading indicator shown inside the pending checkbox.

Status message · optional

Error, warning, or success message below the group.

Theming

Targets

astryx-checkbox-list