A single-column interactive list with keyboard navigation, selection, and accessible item actions - built on RAC GridList.
The ListView component displays a list of interactive items with built-in keyboard navigation, typeahead search, and selection.
import {ListView} from "@heroui-pro/react";
<ListView aria-label="Files" selectionMode="multiple">
<ListView.Item id="report" textValue="report.pdf">
<ListView.ItemContent>
{/* ... */}
<div>
<ListView.Title>report.pdf</ListView.Title>
<ListView.Description>2.4 MB</ListView.Description> {/* Optional */}
</div>
</ListView.ItemContent>
<ListView.ItemAction>{/* ... */}</ListView.ItemAction> {/* Optional */}
</ListView.Item>
</ListView>;Combine with ActionBar for bulk selection workflows. The ActionBar appears when items are selected and provides contextual actions.
primary is the default variant: a gray background wrapper with white surface items forming a card shape. secondary has no background wrapper; items are transparent with bottom borders and use primary (accent) checkboxes for contrast.
ListView supports three selection modes: none (read-only), single (radio-style), and multiple (checkboxes). Selection checkboxes are rendered automatically when selection is enabled.
// No selection
<ListView aria-label="Files" selectionMode="none">
...
</ListView>
// Single selection
<ListView aria-label="Files" selectionMode="single">
...
</ListView>
// Multiple selection
<ListView
aria-label="Files"
selectionMode="multiple"
selectedKeys={selected}
onSelectionChange={setSelected}
>
...
</ListView>Use the disabledKeys prop to disable specific items. Disabled items cannot be selected, focused, or interacted with.
<ListView
aria-label="Files"
disabledKeys={["3", "5"]}
selectionMode="multiple"
>
...
</ListView>HeroUI follows the BEM methodology to ensure component variants and states are reusable and easy to customize.
The List View component uses these CSS classes:
.list-view: Root container. Sets min-height: 0, width: 100%, and outline: none..list-view__item: Individual row. Flex layout with gap, padding, and interactive states..list-view__item-content: Main content area (icon + text). Flex with min-width: 0 for truncation..list-view__title: Primary text. Truncated, text-sm font-medium..list-view__description: Secondary text. Truncated, text-xs text-muted..list-view__item-action: Trailing action slot. Auto-margin to the end..list-view__selection-cell: Checkbox area. Fixed width, flex-shrink: 0..list-view__empty-state: Centered empty state container..list-view--primary: Gray background wrapper with padding and large border-radius. Items have white surface backgrounds..list-view--secondary: No background or padding. Items are transparent with bottom borders.bg-surface/40 (primary) or bg-default/50 (secondary).bg-surface/10 (primary) or bg-accent-soft (secondary).box-shadow: inset 0 0 0 2px var(--color-focus).status-disabled utility.opacity: 0.5.The root list component. Accepts a generic type parameter T for the item data shape. Extends RAC GridListProps.
| Prop | Type | Default | Description |
|---|---|---|---|
aria-label | string | - | Accessible label for the list. Required. |
variant | "primary" | "secondary" | "primary" | Visual variant. |
selectionMode | "none" | "single" | "multiple" | "none" | Item selection mode. |
selectedKeys | Selection | - | Controlled selected item keys. |
defaultSelectedKeys | Selection | - | Default selected keys (uncontrolled). |
onSelectionChange | (keys: Selection) => void | - | Callback when selection changes. |
selectionBehavior | "toggle" | "replace" | "toggle" | Selection interaction model. |
items | Iterable<T> | - | Item objects for dynamic collections. |
disabledKeys | Iterable<Key> | - | Keys of items that should be disabled. |
onAction | (key: Key) => void | - | Callback when a user performs an action on an item. |
renderEmptyState | () => ReactNode | - | Render function for the empty state. |
virtualized | boolean | false | Enable row virtualization for large datasets. |
rowHeight | number | 48 | Estimated row height in pixels for virtualization. |
className | string | - | Additional CSS classes. |
children | ReactNode | ((item: T) => ReactNode) | - | Static items or render function for dynamic collections. |
Individual list item. Extends RAC GridListItemProps.
| Prop | Type | Default | Description |
|---|---|---|---|
id | Key | - | Unique item identifier. |
textValue | string | - | String representation for typeahead and accessibility. |
isDisabled | boolean | - | Whether the item is disabled. |
href | string | - | URL to navigate to when the item is actioned. |
children | ReactNode | - | Item content: typically ItemContent and optionally ItemAction. |
className | string | - | Additional CSS classes. |
Main content container for the item (icon/avatar + text).
| Prop | Type | Default | Description |
|---|---|---|---|
children | ReactNode | - | Icon, avatar, title, description. |
className | string | - | Additional CSS classes. |
Primary text element inside an item.
| Prop | Type | Default | Description |
|---|---|---|---|
children | ReactNode | - | Title text. |
className | string | - | Additional CSS classes. |
Secondary/muted text element inside an item.
| Prop | Type | Default | Description |
|---|---|---|---|
children | ReactNode | - | Description text. |
className | string | - | Additional CSS classes. |
Trailing action slot inside an item.
| Prop | Type | Default | Description |
|---|---|---|---|
children | ReactNode | - | Action buttons, menus, icons. |
className | string | - | Additional CSS classes. |
Resources