View as Markdown

API reference: @salmonui/data-grid

DataGridRowElementPropsinterface

import type { DataGridRowElementProps } from '@salmonui/data-grid';
interface DataGridRowElementProps {
    role: 'row';
    'aria-rowindex': number;
    className: string;
    style?: CSSProperties;
    'data-row-id': RowId;
    'data-row-index': number;
    'aria-selected'?: boolean;
    'data-expanded'?: 'true' | 'false';
    'aria-level'?: number;
    'aria-posinset'?: number;
    'aria-setsize'?: number;
    'aria-expanded'?: boolean;
    'aria-busy'?: boolean;
    'data-alt'?: '';
    ref?: Ref<HTMLDivElement>;
    [key: `data-${string}`]: string | number | boolean | undefined;
}

Props a custom row must spread onto its role="row" element.

DataGridRowElementProps members (15)
NameSignatureDescription
rolerole: 'row';
aria-rowindex'aria-rowindex': number;
classNameclassName: string;
styleoptionalstyle?: CSSProperties;
data-row-id'data-row-id': RowId;
data-row-index'data-row-index': number;
aria-selectedoptional'aria-selected'?: boolean;
data-expandedoptional'data-expanded'?: 'true' | 'false';

Rows with a detail row or child grid: 'true' / 'false'. Not aria-expanded, which ARIA allows on treegrid rows only; the detail toggle button carries aria-expanded.

aria-leveloptional'aria-level'?: number;

Tree mode (role="treegrid" only): depth + 1, sibling ordinal and count, parents' expansion, loading children.

aria-posinsetoptional'aria-posinset'?: number;
aria-setsizeoptional'aria-setsize'?: number;
aria-expandedoptional'aria-expanded'?: boolean;
aria-busyoptional'aria-busy'?: boolean;
data-altoptional'data-alt'?: '';
refoptionalref?: Ref<HTMLDivElement>;