g3-toolkit API Reference
    Preparing search index...

    Interface TableViewProps<T>

    interface TableViewProps<T = TableNodeRow> {
        autoPageSize?: boolean;
        className?: string;
        columnOrder?: readonly string[];
        columns?: readonly DataGridColumn<T>[];
        density?: "comfortable" | "compact";
        emptyMessage?: ReactNode;
        exportCsv?: boolean | TableCsvExport;
        fill?: boolean;
        hideBuiltinColumns?: readonly ("types" | "id")[];
        idFormatter?: (id: string) => string;
        initialSorting?: readonly TableSort[];
        menuManager?: ContextMenuManager;
        onColumnOrderChange?: (order: string[]) => void;
        onPageSizeChange?: (pageSize: number) => void;
        onSortingChange?: (sorting: TableSort[]) => void;
        pageSize?: number;
        pageSizeOptions?: readonly number[];
        renderCell?: (ctx: TableCellContext<T>) => ReactNode;
        rowHeight?: number;
        rowId?: (row: T, index: number) => string;
        rows?: readonly T[];
        search?: boolean;
        selectable?: boolean;
        selection?: TableSelection;
        sorting?: readonly TableSort[];
        toolbar?: ReactNode;
        ugm?: UGM;
        virtualize?: boolean | TableVirtualize;
    }

    Type Parameters

    Index

    Properties

    autoPageSize?: boolean

    In fill mode with rowHeight, derive the page size from the measured scroll region (ResizeObserver) instead of pageSize, so rows meet the bottom edge and re-fit on resize without a remount. No-op where ResizeObserver is absent (jsdom).

    className?: string
    columnOrder?: readonly string[]

    Column order (#47) as TanStack columnOrder: column ids first in this order, the rest after in definition order. Omit it to let the table own the order (the column menu's move buttons still report through onColumnOrderChange, so a host can persist it without controlling it).

    columns?: readonly DataGridColumn<T>[]

    Column definitions for rows. Required for the rows path: the table has no registry to derive columns from.

    density?: "comfortable" | "compact"

    Row density (B3, design-system roadmap): "comfortable" (default) or "compact" for thin-client analyst deployments where row count is the job.

    emptyMessage?: ReactNode

    What the body shows when no row is visible (#58): a single row spanning the table with a role="status" message. Default "No rows match the current filters." (nodes on the UGM path), or "No rows." when the table has no data at all.

    exportCsv?: boolean | TableCsvExport

    Toolbar "Export CSV" button (#47): the FILTERED rows in the current sort, the visible columns in their current order, cell values rather than rendered nodes (see getCsv). Default off. The download is a no-op where URL.createObjectURL is absent (jsdom) unless download is given.

    fill?: boolean

    Fill mode (#21): the root becomes a flex column at 100% of the host's height, the body scrolls with a sticky header, and the pagination bar stays pinned at the bottom. Needs the package stylesheet (@g3-toolkit/react/style.css) and a host with a definite height.

    hideBuiltinColumns?: readonly ("types" | "id")[]

    Hide built-in columns entirely (review 5.19: adapter-fed UGMs whose ids are ordinals and whose type is constant would render two noise columns otherwise). Hidden here means never built, not toggled off, so the visibility menu does not list them.

    idFormatter?: (id: string) => string

    Display-only formatter for the built-in ID column (review 5.18: a projection whose node ids are IRIs can show local names while selection keeps the full id; the cell title carries it).

    initialSorting?: readonly TableSort[]

    Uncontrolled seed (#58): the sort the table starts with. Read once at mount; use sorting to change it later.

    menuManager?: ContextMenuManager

    Optional menu manager for right-click (R2.1 universality).

    onColumnOrderChange?: (order: string[]) => void

    Receives the full next order after every move.

    onPageSizeChange?: (pageSize: number) => void
    onSortingChange?: (sorting: TableSort[]) => void

    Receives the full next sort after every header toggle.

    pageSize?: number

    Page size (default 50; max working-set limit R7.4 is 10,000). Live: a later change re-paginates, keeping the first visible row's page in view (#21: it used to be read once at mount).

    pageSizeOptions?: readonly number[]

    Rows-per-page select (#58) in the pagination bar with these options; the current size is listed even when absent. The pick goes to onPageSizeChange when given (the host then sets pageSize); otherwise it is held internally until the pageSize prop next changes. Pointless with autoPageSize, which measures the size. Default off.

    renderCell?: (ctx: TableCellContext<T>) => ReactNode

    Table-wide cell renderer, both paths. Return undefined to fall back to the column's own rendering for that cell.

    rowHeight?: number

    Row height in px, applied to every data and filler row (#21: density is two padding values, so the row count a host can fit was not derivable). Table rows cannot shrink below their content, so pick a value at least the content's natural height.

    rowId?: (row: T, index: number) => string

    Row identity on the rows path; defaults to the array index. Selection and the table-row-{id} test ids use it.

    rows?: readonly T[]

    Rows path (#39): tabular data that is not a graph (SPARQL bindings, registers, entity lists). Ignored when ugm is set. Hold it in a useMemo: a fresh array each render rebuilds the row model (the same referential-stability contract fixture graphs carry).

    search?: boolean

    Cross-column search box (#47) in the toolbar, above the per-column filters, over the VISIBLE columns only (hidden and filter: "none" columns are skipped), on top of the per-column filters. Since #58 the query is split on whitespace and EVERY word must match, as a case-insensitive substring, somewhere in the row, not necessarily in the same cell; a double-quoted phrase matches as one substring. The "N of M" count reflects it. Default off, so the chrome is unchanged.

    selectable?: boolean

    When false, rows render without click/context-menu handlers and without selection styling (review 5.19: adapter rows carry ordinal ids; writing those into the SHARED selection store would clobber a live canvas selection). Default true.

    selection?: TableSelection

    Selection target (default "store", the pre-#39 behavior). The older selectable={false} is equivalent to "none" and also drops the context menu.

    sorting?: readonly TableSort[]

    Sorting (#58), controlled: TanStack's shape, first rule outermost. Omit it to let the table own the sort (every change still reports through onSortingChange, so a host can persist without controlling, the columnOrder pattern). A controlled sort that names a column no longer in the column set is reported back pruned; an uncontrolled one is pruned in place.

    toolbar?: ReactNode

    Toolbar slot (#58): rendered at the trailing end of the toolbar, beside the Export CSV button, for a host control such as a JSON export.

    ugm?: UGM

    The graph to tabulate (one row per node). Omit it to render rows instead.

    virtualize?: boolean | TableVirtualize

    Row virtualization (#47) through @tanstack/react-virtual over the g3t-table-scroll region: once the current page holds more rows than threshold (default 150), only the rows in and around the scroll window are in the DOM, with spacer rows holding the table's height so the scrollbar is honest and the sticky header stays. Needs a scrolling body: fill (or your own height and overflow on .g3t-table-scroll). rowHeight is the size estimate when given; otherwise rows are measured as they mount. Pagination still applies, so pair it with a large pageSize; autoPageSize is IGNORED while this is set, because it sizes the page to the viewport, which is the one thing virtualization makes unnecessary. Selection, renderCell, filters, search and CSV export read the row model, not the DOM, so they are unaffected. Default off.