UIComponentsReact
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
Installation
npx shadcn@4.23.0 add https://hamur.dev/r/react/grid-list.jsonIt 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.
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.