# DataGridDetailProps (@salmonui/data-grid)

> The DataGridDetailProps interface of @salmonui/data-grid.

Canonical: https://salmonui.dev/docs/reference/data-grid/DataGridDetailProps

```ts
import type { DataGridDetailProps } from '@salmonui/data-grid';
```

Entry index: https://salmonui.dev/docs/reference/data-grid (Markdown with every symbol of the entry: https://salmonui.dev/docs/reference/data-grid.md).

## Reference

Kind: interface

```ts
interface DataGridDetailProps<Row> {
    renderDetail?: (ctx: DataGridDetailContext<Row>) => ReactNode;
    detailHeight?: number;
    hasDetail?: (row: Row) => boolean;
    loadDetail?: (ctx: DataGridDetailLoadContext<Row>) => unknown;
    defaultExpandedDetails?: boolean | readonly RowId[];
    childGrid?: DataGridChildGrid<unknown, Row>;
    onBeforeDetailToggle?: (event: DataGridDetailToggleEvent<Row>) => void;
    onDetailToggle?: (event: DataGridDetailToggleEvent<Row>) => void;
    rowDrag?: boolean | DataGridRowDrag;
    onRowDragStart?: (event: DataGridRowDragEvent<Row>) => void;
    onRowDrag?: (event: DataGridRowDragEvent<Row>) => void;
    onBeforeRowDrop?: (event: DataGridRowDragEvent<Row>) => void;
    onRowDrop?: (event: DataGridRowDragEvent<Row>) => void;
    renderRowDragPreview?: (ctx: DataGridRowDragPreviewContext<Row>) => ReactNode;
}
```

Members (14):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `renderDetail` | `renderDetail?: (ctx: DataGridDetailContext<Row>) => ReactNode;` | optional | Detail row content below each expanded row. |
| `detailHeight` | `detailHeight?: number;` | optional | Estimated detail row height in px before measurement. Default 150. |
| `hasDetail` | `hasDetail?: (row: Row) => boolean;` | optional | Rows without a detail (no toggle). Called for rendered rows only. |
| `loadDetail` | `loadDetail?: (ctx: DataGridDetailLoadContext<Row>) => unknown;` | optional | Async detail content, started on expand; `renderDetail` receives `status`, `data`, `error`. |
| `defaultExpandedDetails` | `defaultExpandedDetails?: boolean \| readonly RowId[];` | optional | Initially expanded details: `true` for every row, or row ids (initial only). |
| `childGrid` | `childGrid?: DataGridChildGrid<unknown, Row>;` | optional | Child grid inside each expanded row (hierarchy grid). An inline object sees child rows as `unknown`; `defineChildGrid<Child, Parent>(config)` types the child rows. |
| `onBeforeDetailToggle` | `onBeforeDetailToggle?: (event: DataGridDetailToggleEvent<Row>) => void;` | optional |  |
| `onDetailToggle` | `onDetailToggle?: (event: DataGridDetailToggleEvent<Row>) => void;` | optional |  |
| `rowDrag` | `rowDrag?: boolean \| DataGridRowDrag;` | optional | Row drag and drop with a drag handle column; `true` reorders within the grid. |
| `onRowDragStart` | `onRowDragStart?: (event: DataGridRowDragEvent<Row>) => void;` | optional | Cancel with `event.preventDefault()`. |
| `onRowDrag` | `onRowDrag?: (event: DataGridRowDragEvent<Row>) => void;` | optional | Once per animation frame while dragging. |
| `onBeforeRowDrop` | `onBeforeRowDrop?: (event: DataGridRowDragEvent<Row>) => void;` | optional | Cancel with `event.preventDefault()`. |
| `onRowDrop` | `onRowDrop?: (event: DataGridRowDragEvent<Row>) => void;` | optional |  |
| `renderRowDragPreview` | `renderRowDragPreview?: (ctx: DataGridRowDragPreviewContext<Row>) => ReactNode;` | optional | Drag preview content (default: the first cell text and the row count). |
