XDSListItem@xds/core · List

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.

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.

Anatomy

ElementDescription
List titlerequiredHeading that labels the list.
DescriptionSupplementary text below the title.
List itemsrequiredIndividual entries, which may include icons or images.
Item descriptionAdditional detail for an individual list item.

Import

ts
import {XDSListItem} from '@xds/core/List'

Props

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.

Showcase source

tsx
'use client';
import {XDSList, XDSListItem} from '@xds/core/List';
import {XDSBadge} from '@xds/core/Badge';
import {XDSIcon} from '@xds/core/Icon';
export default function ListItemShowcase() {
return (
<XDSList header="Settings" hasDividers>
<XDSListItem
label="Notifications"
description="Push, email, and SMS alerts"
startContent={<XDSIcon icon="info" />}
endContent={<XDSBadge label="3 new" variant="blue" />}
onClick={() => {}}
/>
<XDSListItem
label="Privacy"
description="Manage data sharing preferences"
startContent={<XDSIcon icon="eyeSlash" />}
onClick={() => {}}
/>
<XDSListItem
label="Appearance"
description="Theme, font size, and display"
startContent={<XDSIcon icon="wrench" />}
onClick={() => {}}
/>
<XDSListItem
label="Billing"
description="Plans and payment methods"
startContent={<XDSIcon icon="copy" />}
endContent={<XDSBadge label="Pro" variant="purple" />}
onClick={() => {}}
/>
</XDSList>
);
}