Genesis
@stable

DataGrid

packages/ui/src/components/data/DataGrid.tsx

Import
Subpath export: @marktiderman/genesis-ui/data
import { DataGrid } from "@marktiderman/genesis-ui/data";
Components
Auto-generated from TypeScript source via react-docgen-typescript.

DataGrid

PropTypeDefaultDescription
items*T[]—
renderCard*(item: T, index: number) => ReactNode—Render a single card in grid mode
viewMode*enum—
batchSizenumber48Items per infinite scroll batch (grid only). Default 48
focusedIndexnumber-1Keyboard navigation: focused item index (-1 = none)
getItemLabel((item: T) => string)—Accessible name for an activatable item, e.g. `Open ${item.name}`. Used with `onItemClick`.
getKey((item: T) => string)—Unique key extractor. Defaults to (item as any).id
gridColsstringgrid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4Tailwind grid column classes
groupOf((item: T) => { key: string; label: ReactNode; })—Cards and list rows under group headers (ADR 0017): the group an item is in. Items come in group order; a header goes wherever the group changes.
groupSummary((items: T[]) => ReactNode)—What a group's header shows after its count (its totals).
keyboardContainerRefRefObject<HTMLDivElement | null>—Keyboard navigation: container ref for scroll management
onItemClick((item: T) => void)—Open an item. Makes each card (and list row) one keyboard-reachable button: click, Enter or Space activates it, with a focus ring. Clicks on a link, button or input inside the card are left to that control, so a card can still carry its own actions. Use this instead of wrapping cards in a hand-rolled `div role="button"`.
renderListItem((item: T, index: number) => ReactNode)—Render a compact list row
renderTable((items: T[]) => ReactNode)—Render the table view (receives currently visible items)
staggerAnimationbooleantrueAnimate cards with staggered fade-in. Default true

NESTED_CONTROL

What a click inside an activatable item hits instead of the item: a control of its own.

No declared props.