Skip to content
Eskais UI

Data

List Item

Dense, Linear-style rows that also work as entity cards: List, ListGroup (label and count), ListItem with leading, title, subtitle, status, meta, trailing and actions, row actions that keyboards and agents reach without selecting the row, plus ListItemTitle, ListItemMeta, ListItemActions and IconTile. Agents get select(id), and run(id) per row action.

Example

  • This cycle 3
    • Needs review
      ENG-412
      apireliability
    • In progress
      ENG-398
      billing
    • Blocked
      ENG-371
      search

Installation

npx shadcn@latest add @eskais/list-item

Usage

Import
import { list } from "@/components/ui/list-primitive"import { containerClassNames, List, useListContext, useListItemPosition } from "@/components/ui/list"import {  IconTile,  ListItem,  ListItemActions,  ListItemMeta,  ListItemTitle,  List,  ListGroup,} from "@/components/ui/list-item"import { useHandleEntry, useListItemRegistration, useTruncated } from "@/components/ui/use-list-item"import { ListSortableRows } from "@/components/ui/list-sortable"import {  containerClassNames,  ListContext,  PositionContext,  useListContext,  useListItemPosition,} from "@/components/ui/list-context"import {  childId,  childRowsOf,  childText,  defaultId,  defaultText,  listboxKeyDown,  renderChild,} from "@/components/ui/list-rows"import { ListGroup } from "@/components/ui/list-group"import { cellKey, listGrid } from "@/components/ui/list-grid-primitive"import {  ListGridCell,  ListGridProvider,  ListGridRoot,  ListGridRow,  useListGrid,  useListGridInstance,} from "@/components/ui/list-grid"import { listRowAction } from "@/components/ui/list-row-action-primitive"import {  collectRowActions,  ListRowActionCells,  listRowActionLabels,  ListRowActionRoots,  RowActionsContext,  useRowActions,} from "@/components/ui/list-row-actions"import { useListRowActions } from "@/components/ui/use-list-row-actions"

API reference

List

Takes ListProps<Item>.

IconTile

PropTypeDefault
toneTone"neutral"

Also takes <span> attributes and render.

ListItemTitle

Takes <span> attributes and render.

ListItemMeta

Takes <div> attributes and render.

ListItemActions

Takes <div> attributes and render.

ListItem

PropTypeDefault
idrequiredstring–
titlerequiredstring–
controlA control before the content, like a checkbox that selects the row; ignored in a selectable List.ReactNode–
leadingReactNode–
subtitleReactNode–
statusA StatusPill; on a narrow row it wraps below the title instead of squeezing it.ReactNode–
metaInline chips.ReactNode–
trailingAn avatar or a time, at the end.ReactNode–
actionsButtons or a menu, in a List without `rowActions`. Rows of a selectable List are options, which can't hold controls, so it ignores them there: give the List `rowActions` instead, which reach the keyboard as grid cells.ReactNode–
selectedbooleanfalse
hrefstring–
onSelect() => void–
variantOverrides the List's variant.ListVariant–
emphasis`muted` fades the row's text, like a read message; `strong` sets it in a medium weight, like an unread one."muted" | "strong"–
checkLabelThe checkbox's name in a list with `checkedIds`; English by default.string–
classNamestring–

ListSortableRows

PropTypeDefault
labelrequiredstring–
gridrequiredboolean–
idsrequiredstring[]–
indexOfrequiredReadonlyMap<string, number>–
textAtrequired(index: number) => string–
checkedIdsreadonly string[]–
onCheckedIdsChange(ids: string[]) => void–
onReorder(ids: string[], details: ChangeDetails<SortableReason>) => void–
labelsPartial<SortableLabels>–
renderRowrequired(index: number) => ReactNode–

ListGroup

PropTypeDefault
labelrequiredReactNode–
countShown beside the label, like "Proposed 3".number–
classNamestring–
childrenrequiredReactNode–

ListGridProvider

PropTypeDefault
handlerequiredListGridHandle | null–
childrenrequiredReactNode–

ListGridRoot

PropTypeDefault
handlerequiredListGridHandle–

Also takes Record<string, unknown>.

ListGridRow

PropTypeDefault
handlerequiredListGridHandle–
idrequiredstring–
renderrequiredReactElement–

ListGridCell

PropTypeDefault
handlerequiredListGridHandle–
idrequiredstring–
colrequirednumber–
renderrequiredReactElement | ((part: Record<string, unknown>) => ReactElement)–

ListRowActionRoots

PropTypeDefault
kindsrequiredreadonly RowActionKind[]–
labelsrequiredListRowActionLabels–
actionsOfrequired(id: string) => readonly ListRowAction[]–
handlesrequiredMap<string, ListRowActionHandle>–

ListRowActionCells

PropTypeDefault
idrequiredstring–
titlerequiredstring–
gridrequiredListGridHandle | null–
classNamestring–

Other exports

listcontainerClassNamesuseListContextuseListItemPositionuseHandleEntryuseListItemRegistrationuseTruncatedListContextPositionContextchildIdchildRowsOfchildTextdefaultIddefaultTextlistboxKeyDownrenderChildcellKeylistGriduseListGriduseListGridInstancelistRowActioncollectRowActionslistRowActionLabelsRowActionsContextuseRowActionsuseListRowActionstype ListEntrytype ListOptionstype ListSelectReasontype ItemHandletype ListItemPositiontype ListPropstype ListVarianttype ListItemEmphasistype ListItemPropstype ListGroupPropstype ListSortableRowsPropstype ListContextValuetype ListGridOptionstype ListGridValueChangeReasontype ListGridHandletype ListRowActionOptionstype ListRowActionReasontype ListRowActionRowtype ListRowActiontype ListRowActionHandletype ListRowActionLabelstype ListRowActionsVisibilitytype RowActionKindtype RowActionsContextValue

Accessibility

  • The name is on the list itself: a list, or a listbox when rows are selectable, with no group around it.
  • A row selects through a stretched link or button, while its own actions stay separate targets.
  • With value or onValueChange, rows become listbox options with one tab stop.
  • With rowActions, the list is a grid: one tab stop, Left and Right reach a row's actions, and an action never selects the row.

Agent actions

Agents see the list by its label with select(id); a sortable list adds move(id, index) and reorder(ids) under the same name. Row actions are one component each, named by their label, with run(id) for any row that offers them.

Runs agent.snapshot() from @ui-sdk/react/agent on the live preview above.