Table
Data table with rows, actions, and filters.
On this page
Props
| Prop | Type | Default | Description |
|---|---|---|---|
source | DataSource | None | Resource binding to fetch rows from |
columnsSource | DataSource | None | Resource binding that supplies the column definitions at run time |
data | readonly Record<string, unknown>[] | None | Inline data (alternative to source) |
columns | readonly TableColumn[] | None | Column definitions |
variant | "default" | "data" | None | Visual style |
rowLink | TableRowLink | None | Link each row to a route |
rowActions | readonly TableRowAction[] | None | Per-row action buttons |
actions | readonly TableRowMenuAction[] | None | Table-level menu actions |
searchable | boolean | None | Show search input |
filters | readonly TableFilter[] | None | Column filter dropdowns |
pageSize | number | None | Rows per page |
Example
ts
Table({
source: warehouses(),
columns: [
{ id: "name", label: "Name" },
{ id: "status", label: "Status" },
],
rowActions: [
{
label: "Suspend",
action: suspendWarehouse,
input: { warehouse: "name" },
when: { field: "status", equals: "RUNNING" },
},
],
searchable: true,
})Supporting types
TableColumn
export interface TableColumn {
id: string;
label: string;
format?: "duration" | "progress" | "eta";
renderCell?: PageNode | readonly PageNode[];
}TableRowLink
export interface TableRowLink {
path: string;
params: Record<string, string>;
}TableRowAction
export interface TableRowAction {
label: string;
icon?: string;
variant?: "primary" | "secondary" | "danger";
action?: AnyActionDefinition | string;
link?: TableRowLink;
input?: Record<string, string>;
successLink?: TableRowLink;
confirmation?: {
title: string;
description: string;
confirmLabel?: string;
};
when?: {
field: string;
equals?: string | number | boolean;
notEquals?: string | number | boolean;
};
disabledWhen?: {
field: string;
equals?: string | number | boolean;
notEquals?: string | number | boolean;
};
}TableRowMenuAction
export interface TableRowMenuAction {
label: string;
action?: AnyActionDefinition | string;
input?: Record<string, string>;
link?: TableRowLink;
successLink?: TableRowLink;
confirmation?: {
title: string;
description: string;
confirmLabel?: string;
};
when?: {
field: string;
equals?: string | number | boolean;
notEquals?: string | number | boolean;
};
}TableFilter
export interface TableFilter {
field: string;
label: string;
options: readonly { label: string; value: string }[];
}PageTableRowLink
export type PageTableRowLink = {
path: string;
params: Record<string, string>;
};PageTableRowAction
export type PageTableRowAction = {
label: string;
variant?: "primary" | "secondary" | "danger";
action: {
actionId: string;
input?: Record<string, string>;
};
successLink?: PageTableRowLink;
confirmation?: {
title: string;
description: string;
confirmLabel?: string;
};
when?: {
field: string;
equals?: string | number | boolean;
notEquals?: string | number | boolean;
};
disabledWhen?: {
field: string;
equals?: string | number | boolean;
notEquals?: string | number | boolean;
};
};