When supplied, indicates the property for a data object to use to get a unique identifier. See also the 'columns.primary' description. Use this property when the columns approach will not work for your data set.
Custom label to be used by screen readers. When provided, an aria-label will be added to the element.
"a user friendly label for screen readers"How to align along the cross axis when contained in a Box or along the column axis when contained in a Grid.
"start""center""end""stretch"Cell background. You can set the background per context by passing an object with keys for 'heading', 'body', and/or 'footer'. If you pass an array, rows will cycle between the array values.
"light-2"["white", "light-2"]{
"header": "dark-2",
"body": ["white", "light-2"],
"footer": "dark-3"
}Cell border. You can set the border per context by passing an object with keys for 'heading', 'body', and/or 'footer'.
true"horizontal"{
"color": "border",
"side": "horizontal",
"size": "small"
}{
"header": "bottom",
"body": {
"color": "light-2",
"side": "bottom"
},
"footer": "top"
}A description of the data. The order controls the column order. 'property' indicates which property in the data objects to associate the column with. 'header' indicates what to display in the column header. 'render' allows for custom rendering of body cells. Use 'render' for custom formatting for things like currency and date or to display rich content like Meters. 'align' indicates how the cells in the column are aligned. 'aggregate' indicates how the data in the column should be aggregated. This only applies to a footer or groupBy context. 'footer' indicates what should be shown in the footer for the column. 'search' indicates whether a search filter should be made available for the column. 'primary' indicates that this property should be used as the unique identifier, which gives the cell 'row' scope for accessibility. If 'primary' is not used for any column, and 'primaryKey' isn't specified either, then the first column will be used.
[
{
"align": "center",
"aggregate": "avg",
"footer": {"aggregate": true},
"header": "Name",
"primary": true,
"property": "name",
"render": "(datum) => <Content />",
"search": true,
"sortable": true
}
]Property to group data by. If object is specified 'property' is used to group data by, 'expand' accepts array of group keys that sets expanded groups and 'onExpand' is a function that will be called after expand button is clicked with an array of keys of expanded groups.
"location"{
"property": "location",
"expand": ["Paris", "Los Angeles"],
"onExpand": "(key) => {...}"
}The amount of margin around the component. An object can be specified to distinguish horizontal margin, vertical margin, and margin on a particular side.
"xsmall""small""medium""large""xlarge"{
"vertical": "...",
"horizontal": "...",
"top": "...",
"bottom": "...",
"left": "...",
"right": "..."
}When supplied, this function will be called with an event object that include a 'datum' property containing the data value associated with the clicked row. You should not include interactive elements, like Anchor or Button inside table cells as that can cause confusion with overlapping interactive elements.
({ datum }) => {...}Use this to indicate that 'data' doesn't contain all that it could. It will be called when all of the data rows have been rendered. This might be used when the total number of items that could be retrieved is more than you'd want to load into the browser. 'onMore' allows you to lazily fetch more from the server only when needed. This cannot be combined with properties that expect all data to be present in the browser, such as columns.search, sortable, groupBy, or columns.aggregate.
() => {...}When supplied, and when at least one column has 'search' enabled, this function will be called with an object with keys for property names and values which are the search text strings. This is typically employed so a back-end can be used to search through the data.
({ key: "search text", ... }) => {...}Cell padding. You can set the padding per context by passing an object with keys for 'heading', 'body', and/or 'footer'.
Whether to replace previously rendered items with a generic spacing element when they have scrolled out of view. This is more performant but means that in-page searching will not find elements that have been replaced.
Row specific background, border, and pad, keyed by primary key value. For example: { "primary-key-value": { background: ..., border: ..., pad: ... }}, where the background, border, and pad accept the same values as the same named properties on DataTable.
The height of the table body. If set, the table body will have a fixed height and the rows will be scrollable within it. In order to preserve header and footer cell alignment, all cells will have the same width. This cannot be used in combination with 'resizeable'.