Black Friday · Save 40% on Intent UI Design licenses with code UI2026.· 4 days left

Grid List

Loading...

Installation

Add the component with the CLI.

npx shadcn@latest add @intentui/grid-list

Composed components

When you install this component via the CLI, it automatically loads all composed components, so you don’t need to add them individually.

Manual installation

Install the dependencies, then copy the component source into your project.

npm install react-aria-components cn

Anatomy

import { GridList, GridListItem } from "@/components/ui/grid-list"
const items = [
  { id: "1", name: "The Beatles" },
  ...
]

<GridList
  selectionMode="single"
  items={items}
  aria-label="Select your favorite bands"
  className="min-w-64"
>
  {(item) => <GridListItem id={item.id}>{item.name}</GridList.Item>}
</GridList>

Examples

Multiple selection

Set selectionMode="multiple" to allow multiple selections.

Loading...

Assign each grid list item a stable id:

{(item) => <GridListItem id={item.name}>{item.name}</GridListItem>}

Drag and drop

The grid list supports drag and drop functionalities if you use the dragAndDropHooks prop along with the useDragAndDrop hook. You can drop data on the entire list, individual items, add new items between existing ones, or rearrange items.

Loading...

Dragging between items

You can move items between positions within the grid list.

Loading...

Render empty state

The grid list can display an empty state when no items are available using the renderEmptyState prop.

Loading...

Infinite scrolling

Load more items as users scroll with infinite scrolling.

Loading...

Section

The grid list supports sections, allowing you to group items under different headings.

Loading...

Controlled

The grid list can be controlled, which means the parent component manages the selection state of each item.

Loading...

Disabled

Similar to how the Tag Group component can be disabled using isDisabled for children and disabledKeys for the parent, the Grid List supports similar functionality. For example, items "Led Zeppelin" and "The Rolling Stones" are disabled.

Loading...

To disable items via the parent component, you can use the disabledKeys prop like this:

<GridList
  items={items}
  aria-label="Select your favorite bands"
  selectionMode="multiple"
  disabledKeys={[2,5]}
  className="min-w-64"
>
  {(item) => <GridListItem id={item.id}>{item.name}</GridListItem>}
</GridList>

Component API

GridList

GridList extends the React Aria Components <GridList> component.

classNamestring

GridListDescription

GridListDescription extends the React Aria Components <Text> component.

classNamestring

GridListEmptyState

GridListEmptyState extends the native <div> element.

classNamestring

GridListHeader

GridListHeader extends the React Aria Components <GridListHeader> component.

classNamestring

GridListItem

GridListItem extends the React Aria Components <GridListItem> component.

classNamestring

GridListLabel

GridListLabel extends the React Aria Components <Text> component.

classNamestring

GridListSection

GridListSection extends the React Aria Components <GridListSection> component.

classNamestring

GridListSpacer

GridListSpacer extends the native <div> element.

classNamestring

GridListStart

GridListStart extends the native <div> element.

classNamestring

See the React Aria for the full API reference.

Design