Properties of the TableControl React component.

interface TableControlProps<T> {
    columns: TableColumn<T>[];
    data: T[];
    dataKey: (row: T) => Key;
    hasRemoveButton?: boolean;
    hover?: boolean;
    label?: string;
    labelVariant?: Variant;
    maxHeight?: string | number;
    onClickRow?: (row: T) => void;
    onRemoveRow?: (row: T) => void;
    removeButtonTitle?: string;
    selectedKey?: Key;
    size?: "small" | "medium";
    stickyHeader?: boolean;
}

Type Parameters

  • T

Properties

columns: TableColumn<T>[]

Column definitions.

data: T[]

Data rows to be displayed.

dataKey: (row: T) => Key

Callback to get a unique data key for the specified row.

hasRemoveButton?: boolean

If each row should have a remove button

hover?: boolean

If true, the table row will shade on hover, defaults to false.

label?: string

An optional table label.

labelVariant?: Variant

An optional Typography variant to be used for the label.

maxHeight?: string | number

Optional max height.

onClickRow?: (row: T) => void

Callback to inform that a data row has been clicked.

onRemoveRow?: (row: T) => void

Callback to be run when clicking on the remove button

removeButtonTitle?: string

A title for the remove button

selectedKey?: Key

The key of the currently selected data row.

size?: "small" | "medium"

Table size, defaults to 'medium'.

stickyHeader?: boolean

Set the header sticky, defaults to false.