Skip to content
CraftDocs
GitHub
Home
Home
Changelog
What's New
Guide
Guide
Getting Started
Principles
Styling Components
Theme System
Foundations
All Tokens
Color
Elevation
Icons
Motion
Shape
Spacing
Typography
Libraries
Libraries
@xds/cli
@xds/core
Themes
Themes
Theme: daily
Default Theme
Theme: matcha
Neutral Theme
Components
Components
AppShell
AspectRatio
Avatar
Avatar
AvatarStatusDot
Badge
Banner
Breadcrumbs
BreadcrumbItem
Breadcrumbs
Button
Button
IconButton
ToggleButton
ToggleButtonGroup
Calendar
Card
Carousel
Chat
ChatComposer
ChatComposerDrawer
ChatComposerInput
ChatComposerTokenElement
ChatDictationButton
ChatLayout
ChatLayoutScrollButton
ChatMessage
ChatMessageBubble
ChatMessageList
ChatMessageMetadata
ChatSendButton
ChatSystemMessage
ChatTokenizedText
ChatToolCalls
Checkbox
CheckboxInput
CheckboxList
CheckboxListItem
ClickableCard
Code
CodeBlock
Collapsible
Collapsible
CollapsibleGroup
useXDSCollapsible
CommandPalette
CommandPalette
CommandPaletteEmpty
CommandPaletteFooter
CommandPaletteGroup
CommandPaletteInput
CommandPaletteItem
CommandPaletteList
DateInput
Dialog
AlertDialog
Dialog
DialogHeader
useXDSImperativeAlertDialog
useXDSImperativeDialog
Divider
DropdownMenu
DropdownMenu
DropdownMenuDivider
DropdownMenuItem
DropdownMenuItemData
DropdownMenuSection
EmptyState
Field
Field
FieldLabel
FieldStatus
Heading
HoverCard
Icon
Kbd
Layout
Center
FormLayout
Grid
GridSpan
HStack
Layout
LayoutContainer
LayoutContent
LayoutFooter
LayoutHeader
LayoutPanel
Section
StackItem
VStack
Link
List
List
ListItem
Markdown
MetadataList
MetadataList
MetadataListItem
MobileNav
MoreMenu
NavHeadingMenu
NavIcon
NumberInput
OverflowList
Pagination
Popover
PowerSearch
ProgressBar
Radio
RadioList
RadioListItem
Resizable
ResizeHandle
useXDSResizable
SegmentedControl
SegmentedControl
SegmentedControlItem
SelectableCard
Selector
MultiSelector
Selector
SelectorOption
SideNav
SideNav
SideNavCollapseButton
SideNavHeading
SideNavItem
SideNavSection
Skeleton
Slider
Spinner
StatusDot
Switch
Table
BaseTable
Table
TableCell
TableHeaderCell
TableRow
useXDSTableColumnSettings
useXDSTablePagination
useXDSTableSelection
useXDSTableSelectionState
useXDSTableSortable
Tabs
Tab
TabList
TabMenu
Text
TextArea
TextInput
Thumbnail
TimeInput
Timestamp
Toast
Toast
useXDSToast
Token
Tokenizer
Toolbar
Tooltip
TopNav
TopNav
TopNavHeading
TopNavItem
TopNavMegaMenu
TopNavMegaMenuFeaturedCard
TopNavMegaMenuItem
TopNavMenu
TreeList
Typeahead
BaseTypeahead
Typeahead
TypeaheadItem
useXDSHoverCard
useXDSPopover
useXDSTooltip
Utilities
Utilities
LinkProvider
MediaTheme
SyntaxTheme
Theme
useClickableContainer
useEntryAnimation
useFocusTrap
useGridFocus
useImageMode
useInputContainer
useListFocus
useMediaQuery
useOverflow
useScrollLock
useScrollOverflow
useXDSLayer
useXDSStreamingText
Terms of UsePrivacy Policy
Type to search
↑↓Navigate↵SelectEscClose
List@xds/core · XDSList v0.0.13

Usage

A vertical collection of items with consistent spacing, dividers, and optional markers. Supports headers, icons, avatars, badges, and interactive items with click or link behavior. Use it to display ordered or unordered groups of related content.
ts
import {XDSList} from '@xds/core/List'

Best practices

GuidancePractices
DoProvide a header to label the list and give context to screen readers.
DoUse start and end content slots to add icons, avatars, or badges to each item.
Don'tPlace interactive elements inside an interactive list item — it creates nested click targets and confusing focus behavior.
Don'tUse a list for a single item or for laying out unrelated content — lists imply a meaningful collection.
Don'tMix clickable and non-clickable items in the same list without clear visual distinction.

Sub-components

List is a compound component with 2 sub-components.

XDSList

List container with density, dividers, and header support.
PropTypeDescription
children
ReactNodeList items (XDSListItem components).
density
'compact' | 'balanced' | 'spacious' (default: 'balanced')Spacing density for items.
hasDividers
boolean (default: false)Show dividers between items.
header
ReactNodeHeader content, associated with the list via aria-labelledby.
listStyle
'none' | 'disc' | 'decimal' | 'circle' (default: 'none')List marker style. 'decimal' renders an <ol> element instead of <ul>.
xstyle
StyleXStylesStyleX styles for layout customization (margins, positioning, sizing). Must be a stylex.create() value — not an inline style object like style={{}}.

XDSListItem

List item with label, description, start/end content slots, and interactive patterns.
PropTypeDescription
labelrequired
stringPrimary text.
description
ReactNodeSecondary content below the label. A plain string gets single-line truncation automatically; a ReactNode lets child components control their own wrapping and line-clamp behavior.
startContent
ReactNodeContent rendered before the label area (e.g. icon, avatar).
endContent
ReactNodeContent rendered after the label area (e.g. badge, chevron).
onClick
(e: MouseEvent) => voidClick handler; enables the invisible button pattern.
href
stringLink URL; enables the invisible anchor pattern.
target
stringLink target attribute, only applicable when href is provided.
isDisabled
boolean (default: false)Disabled state; sets aria-disabled on the item.
isSelected
boolean (default: false)Selected state; sets aria-selected on the item.

Examples

Common configurations, variations, and states.
List — BasicSimple list with labels and descriptions for settings-style layouts.
tsx
'use client';
​
import {XDSList, XDSListItem} from '@xds/core/List';
​
export default function ListBasicList() {
return (
<XDSList>
<XDSListItem label="Notifications" description="Manage your alerts" />
<XDSListItem label="Privacy" description="Control your data" />
<XDSListItem label="Security" description="Password and 2FA" />
</XDSList>
);
}
List — Bulleted FeaturesBulleted list of feature highlights using disc markers.
tsx
'use client';
​
import {XDSList, XDSListItem} from '@xds/core/List';
​
export default function ListBulletedFeatures() {
return (
<XDSList listStyle="disc">
<XDSListItem label="Accessible by default" />
<XDSListItem label="Themeable with StyleX" />
<XDSListItem label="Composable and extensible" />
</XDSList>
);
}
List — Message ListChat-style message list with avatars, preview text, and unread badges.
tsx
'use client';
​
import {XDSList, XDSListItem} from '@xds/core/List';
import {XDSAvatar} from '@xds/core/Avatar';
import {XDSBadge} from '@xds/core/Badge';
​
export default function ListMessageList() {
return (
<XDSList hasDividers>
<XDSListItem
label="Alex Johnson"
description="Hey, are we still on for lunch tomorrow?"
startContent={<XDSAvatar name="Alex Johnson" size={40} />}
onClick={() => {}}
endContent={<XDSBadge label="2" />}
/>
<XDSListItem
label="Sam Rivera"
description="I pushed the latest changes to the repo"
startContent={<XDSAvatar name="Sam Rivera" size={40} />}
onClick={() => {}}
/>
<XDSListItem
label="Jordan Lee"
description="Can you review the design spec when you get a chance?"
startContent={<XDSAvatar name="Jordan Lee" size={40} />}
onClick={() => {}}
endContent={<XDSBadge label="5" />}
/>
</XDSList>
);
}
List — Ordered StepsNumbered step-by-step instructions using decimal list markers.
tsx
'use client';
​
import {XDSList, XDSListItem} from '@xds/core/List';
​
export default function ListOrderedSteps() {
return (
<XDSList listStyle="decimal">
<XDSListItem
label="Install the package"
description="npm install @xds/core"
/>
<XDSListItem
label="Import components"
description="import { XDSList } from '@xds/core'"
/>
<XDSListItem
label="Start building"
description="Use components in your app"
/>
</XDSList>
);
}

Showcase source

tsx
'use client';
​
import {XDSList, XDSListItem} from '@xds/core/List';
​
export default function ListShowcase() {
return (
<XDSList>
<XDSListItem label="Notifications" description="Manage your alerts" />
<XDSListItem label="Privacy" description="Control your data" />
<XDSListItem label="Security" description="Password and 2FA" />
</XDSList>
);
}