Skip to content

Early previewhamur is not on npm yet. The components are being built in the open, follow along on GitHub.

UIComponentsReact

Grid List

A list of rows that each hold a title, a description and their own buttons, with one or many selected, laid out in a column or wrapped into cards.

Built on the headless Grid List.See its API in Docs

Rendered by React 19.3.1

grid-list.tsx

Installation

npx shadcn@4.23.0 add https://hamur.dev/r/react/grid-list.json

It also adds utils. The app needs its setup first: Installation.

Usage

Put one GridListItem per row inside GridList, with one GridListItemContent inside it: the row's cell, laid out as an Item with a GridListItemText (the row's name), an optional GridListItemDescription, and the row's own buttons or links. GridListItemIndicator shows the selection, GridListItemHandle is the place a drag starts, and GridListGroup with its GridListGroupLabel heads a set of rows. GridListEmpty shows while the list has no rows. The keys, the selection, the actions, the wrapped layout, moving rows and virtualization come from the headless Grid List.

import {
  GridList,
  GridListEmpty,
  GridListGroup,
  GridListGroupLabel,
  GridListItem,
  GridListItemContent,
  GridListItemDescription,
  GridListItemHandle,
  GridListItemIndicator,
  GridListItemText,
} from '@/components/ui/grid-list'

Examples

Default

Files with a description and a Share button, one selected.

Its preview and code are at the top of the page.

The focused row takes a ring and the selected row a tinted ground. In a multiple list the indicator is a Checkbox's box; pass keepMounted so an unchecked box stays. With layout="grid" the rows wrap into bordered cards, as many to a line as fit. While a row is dragged over another, a line before or after it shows where it will land. This item takes Base UI's component ID as its slug and one name per Base UI part.

API reference

The styled parts pass every prop to the headless part they wrap and add classes. The props, data attributes and keyboard are on Grid List's API reference.