Individual checkbox item with label, description, and end content slot. Works in collection mode (inside CheckboxList) or standalone mode (inside List).
Preview loads on approachPreview loads on approach
Exact source · checkbox-list-item-showcase
// Copyright (c) Meta Platforms, Inc. and affiliates.
'use client';
import {useState} from 'react';
import {CheckboxList, CheckboxListItem} from '@astryxdesign/core/CheckboxList';
export default function CheckboxListItemShowcase() {
const [value, setValue] = useState<string[]>(['updates', 'security']);
return (
<CheckboxList
label="Email preferences"
value={value}
onChange={setValue}
hasDividers>
<CheckboxListItem
label="Product updates"
value="updates"
description="New features and improvements"
/>
<CheckboxListItem
label="Security alerts"
value="security"
description="Important account security notifications"
/>
<CheckboxListItem
label="Marketing"
value="marketing"
description="Tips, offers, and promotions"
/>
<CheckboxListItem
label="Beta program"
value="beta"
description="Currently closed to new members"
isDisabled
/>
</CheckboxList>
);
}
Usage
Individual checkbox item with label, description, and end content slot. Works in collection mode (inside CheckboxList) or standalone mode (inside List).
Typed props
Prop
Type and behavior
label
ReactNode · required
Primary text label for the item. Rich labels may contain links or buttons, which keep their own behavior without toggling the item. A ReactNode label names the checkbox from its visible text; pass aria-label only when that text is absent, or include all visible label words in the override.
aria-label
string
Plain-text accessible name for the checkbox, replacing the one derived from label. Applied to the checkbox control. Use it when a rich label has no visible text; otherwise the value must retain every visible label word.
Secondary content below the label. String or ReactNode. Exposed as the checkbox's accessible description through aria-describedby, so assistive technology can tell it is the explanation for that choice.
Whether this item is loading. Shows a spinner inside the checkbox and blocks interaction on this item. In collection mode, the toggled item also shows this automatically while the parent changeAction is pending.