DataGrid
packages/ui/src/components/data/DataGrid.tsx
Import
Subpath export:
@marktiderman/genesis-ui/dataimport { DataGrid } from "@marktiderman/genesis-ui/data";Components
Auto-generated from TypeScript source via
react-docgen-typescript.DataGrid
| Prop | Type | Default | Description |
|---|---|---|---|
| items* | T[] | — | |
| renderCard* | (item: T, index: number) => ReactNode | — | Render a single card in grid mode |
| viewMode* | enum | — | |
| batchSize | number | 48 | Items per infinite scroll batch (grid only). Default 48 |
| focusedIndex | number | -1 | Keyboard 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 |
| gridCols | string | grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 | Tailwind 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). |
| keyboardContainerRef | RefObject<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) |
| staggerAnimation | boolean | true | Animate 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.