Skip to content

Function: DataTable()

ts
function DataTable(props: BaseProps<unknown, unknown> & {
  hidden?: AsyncProp<boolean>;
  disabled?: AsyncProp<boolean>;
  data?:   | unknown[]
     | (params: {
     data: Record<string, unknown>;
     value: unknown;
   }) => unknown[] | Promise<unknown[]>;
}): Block;

Defined in: src/renderer/blocks/index.ts:1608

Experimental

DataTable — sortable, filterable table with row selection, column visibility, and pagination. Built on @tanstack/react-table.

Parameters

ParameterType
propsBaseProps<unknown, unknown> & { hidden?: AsyncProp<boolean>; disabled?: AsyncProp<boolean>; data?: | unknown[] | (params: { data: Record<string, unknown>; value: unknown; }) => unknown[] | Promise<unknown[]>; }

Returns

Block

Example

ts
DataTable({
  columns: [
    {accessorKey: 'name', header: 'Name'},
    {accessorKey: 'status', header: 'Status'},
    {accessorKey: 'role', header: 'Role'},
  ],
  data: [
    {name: 'Ada Lovelace', status: 'active', role: 'Admin'},
    {name: 'Alan Turing', status: 'invited', role: 'Member'},
  ],
  searchKey: 'name',
});

Matterway Assistant SDK Documentation