Skip to content

List

Semantic vertical list container with optional dividers, markers, and header.

Settings
  • NotificationsManage notification preferences
  • SecurityControl account securityRequired
<List {...args} header="Settings">
<ListItem
description="Manage notification preferences"
endContent={<Icon icon={ChevronRight} size="sm" />}
label="Notifications"
startContent={<Icon color="accent" icon={Bell} size="sm" />}
/>
<ListItem
description="Control account security"
endContent={<Badge color="warning" label="Required" />}
label="Security"
startContent={<Icon color="success" icon={Shield} size="sm" />}
/>
</List>
  • First item
  • Second item
  • Third item
<List {...args}>
<ListItem label="First item" />
<ListItem label="Second item" />
<ListItem label="Third item" />
</List>
Setup steps
  1. Create project
  2. Invite teammates
  3. Configure billing
<List {...args} header="Setup steps">
<ListItem label="Create project" />
<ListItem label="Invite teammates" />
<ListItem label="Configure billing" />
</List>
  • Apples
  • Bananas
  • Cherries
<List {...args}>
<ListItem label="Apples" />
<ListItem label="Bananas" />
<ListItem label="Cherries" />
</List>
  • Apples
  • Bananas
  • Cherries
<List {...args}>
<ListItem label="Apples" />
<ListItem label="Bananas" />
<ListItem label="Cherries" />
</List>
Actions
<List hasDividers header="Actions">
<ListItem
label="Edit profile"
onClick={() => {}}
startContent={<Icon icon={User} size="sm" />}
/>
<ListItem
label="Notifications"
onClick={() => {}}
startContent={<Icon icon={Bell} size="sm" />}
/>
<ListItem
label="Security"
onClick={() => {}}
startContent={<Icon icon={Shield} size="sm" />}
/>
</List>
<List hasDividers>
<ListItem
endContent={<Icon icon={ChevronRight} size="sm" />}
href="/profile"
label="Profile"
/>
<ListItem
endContent={<Icon icon={ChevronRight} size="sm" />}
href="/settings"
label="Settings"
/>
<ListItem
endContent={<Icon icon={ChevronRight} size="sm" />}
href="https://example.com"
label="External docs"
rel="noopener noreferrer"
target="_blank"
/>
</List>
<List hasDividers>
<ListItem label="Active item" onClick={() => {}} />
<ListItem isDisabled label="Disabled item" onClick={() => {}} />
<ListItem label="Another active item" onClick={() => {}} />
</List>
<List hasDividers>
<ListItem label="Home" onClick={() => {}} />
<ListItem isSelected label="Dashboard" onClick={() => {}} />
<ListItem label="Settings" onClick={() => {}} />
</List>
Continued steps
  1. Deploy to staging
  2. Run integration tests
  3. Deploy to production
<List {...args} header="Continued steps" start={4}>
<ListItem label="Deploy to staging" />
<ListItem label="Run integration tests" />
<ListItem label="Deploy to production" />
</List>
  • NotificationsManage notification preferences3 new
  • Simple item
  • FavoritesView and manage saved items
  • With end content only
<List hasDividers>
<ListItem
description="Manage notification preferences"
endContent={<Badge color="info" label="3 new" />}
label="Notifications"
startContent={<Icon color="accent" icon={Bell} size="sm" />}
/>
<ListItem label="Simple item" />
<ListItem
description="View and manage saved items"
label="Favorites"
startContent={<Icon color="warning" icon={Star} size="sm" />}
/>
<ListItem
endContent={<Icon icon={ChevronRight} size="sm" />}
label="With end content only"
/>
</List>
  • A very long label that might need to be truncated when it exceeds the available spaceThis is a very long description that should demonstrate how the component handles text overflow when the content exceeds the available width of the container
  • Short item
  • Medium length label for comparisonAnother long description to show consistent behavior
<div style={{maxWidth: 400}}>
<List hasDividers>
<ListItem
description="This is a very long description that should demonstrate how the component handles text overflow when the content exceeds the available width of the container"
label="A very long label that might need to be truncated when it exceeds the available space"
/>
<ListItem label="Short item" />
<ListItem
description="Another long description to show consistent behavior"
label="Medium length label for comparison"
/>
</List>
</div>

Semantic vertical list container with optional dividers, markers, and header.

PropTypeDefaultDescription
children*ReactNodeList items.
classNamestringAdditional CSS class names applied to the list element.
data-testidstringTest ID applied to the list element.
hasDividersbooleanfalseWhether to show dividers between list items.
headerReactNodeHeader content rendered above and associated with the list.
listStyle"none" | "circle" | "disc" | "decimal"'none'List marker style. decimal renders an ordered list.
refRef<HTMLUListElement | HTMLOListElement>Ref forwarded to the list element.
startnumber1Starting number for ordered lists.
styleCSSPropertiesInline styles applied to the list element.

Structured list item built on the shared `Item` primitive.

PropTypeDefaultDescription
classNamestringAdditional CSS class names applied to the list item.
data-testidstringTest ID applied to the list item.
descriptionReactNodeSupporting text shown below the label.
endContentReactNodeTrailing content rendered after the label area.
hrefstringLink URL. When set, the content area renders as a link.
isDisabledbooleanfalseWhether the item is disabled.
isSelectedbooleanfalseWhether the item is selected.
label*ReactNodePrimary item label.
onClickMouseEventHandler<HTMLElement>Click handler for interactive items.
refRef<HTMLLIElement>Ref forwarded to the list item.
relstringLink relationship.
startContentReactNodeContent rendered before the label area.
styleCSSPropertiesInline styles applied to the list item.
targetstringLink target.