A list of interactive rows with support for keyboard navigation, single or multiple selection, and row actions.
import { List, ListRow } from '@backstage/ui';
<List aria-label="Programming languages" items={items}>
{item => <ListRow id={item.id}>{item.label}</ListRow>}
</List>Container for a list of interactive rows.
| Prop | Type | Default | Description |
|---|---|---|---|
| items | Iterable<T> | - | Item objects in the collection. |
| renderEmptyState | (props: GridListRenderProps) => ReactNode | - | Content to display when the collection is empty. |
| selectionMode | nonesinglemultiple | - | The type of selection allowed. |
| selectedKeys | allIterable<Key> | - | The currently selected keys (controlled). |
| defaultSelectedKeys | allIterable<Key> | - | The initial selected keys (uncontrolled). |
| disabledKeys | Iterable<Key> | - | Keys of items that should be disabled. |
| onSelectionChange | (keys: Selection) => void | - | Handler called when the selection changes. |
| children | ReactNode | - | |
| className | string | - | Additional CSS class name for custom styling. |
Inherits all React Aria GridList props.
Individual row within a List.
| Prop | Type | Default | Description |
|---|---|---|---|
| id | string | - | Unique identifier for the row. |
| textValue | string | - | Text value for accessibility. Derived from children if string. |
| icon | ReactNode | - | Icon displayed before the row label. |
| description | string | - | Secondary description text displayed below the label. |
| isDisabled | boolean | - | Whether the row is disabled. |
| menuItems | ReactNode | - | Menu items rendered inside an automatically managed dropdown. Pass MenuItem nodes. |
| customActions | ReactNode | - | Custom action elements displayed on the right side of the row, e.g. tags. |
| children | ReactNode | - | |
| className | string | - | Additional CSS class name for custom styling. |
Inherits all React Aria GridListItem props.
<List aria-label="Programming languages" items={items}>
{item => (
<ListRow id={item.id} icon={item.icon}>
{item.label}
</ListRow>
)}
</List><List aria-label="Programming languages" items={items}>
{item => (
<ListRow id={item.id} icon={item.icon} description={item.description}>
{item.label}
</ListRow>
)}
</List>const [selected, setSelected] = useState(new Set(['react']));
<List
aria-label="Programming languages"
items={items}
selectionMode="single"
selectedKeys={selected}
onSelectionChange={setSelected}
>
{item => <ListRow id={item.id}>{item.label}</ListRow>}
</List>const [selected, setSelected] = useState(new Set(['react', 'typescript']));
<List
aria-label="Programming languages"
items={items}
selectionMode="multiple"
selectedKeys={selected}
onSelectionChange={setSelected}
>
{item => <ListRow id={item.id}>{item.label}</ListRow>}
</List><List
aria-label="Programming languages"
items={items}
disabledKeys={['typescript', 'rust']}
>
{item => <ListRow id={item.id}>{item.label}</ListRow>}
</List>Our theming system is based on a mix between CSS classes, CSS variables and data attributes. If you want to customise this component, you can use one of these class names below.
bui-List