Dynamic table
A dynamic table displays rows of data with built-in pagination, sorting, and re-ordering functionality.Neutral selected states
When the platform-dst-tokens-finesse feature flag is enabled, this component uses the new neutral treatment for selected states.
Installation
| Install | yarn add @atlaskit/dynamic-table |
|---|---|
| Source | Bitbucket.org, (opens new window) |
| npm | @atlaskit/dynamic-table, (opens new window) |
| Bundle | unpkg.com, (opens new window) |
Props
| Description | Caption for the table styled as a heading. This appears before the table header, and is announced when people who use assistive technology land on the table.
If you don’t want the caption to appear on the page but do want it to be available for assistive technology, surround the caption with |
|---|---|
| Type | string | number | boolean | ReactElement<any, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal |
| Description | You should not be accessing this prop under any circumstances.
It is provided by |
|---|---|
| Type | (payload: AnalyticsEventPayload) => UIAnalyticsEvent |
| Description | When the table is initially rendered, use this to set which page number is shown by default.
In most circumstances, people will expect this to be page |
|---|---|
| Type | number |
| Description | Sets which column the rows should be sorted by when the table is initially rendered.
Corresponds to the |
|---|---|
| Type | string |
| Description | Default column sort order used when initially rendering.
Defaults to |
|---|---|
| Type | "ASC" | "DESC" |
| Description | Shown when the table has no content. |
|---|---|
| Type | ReactElement<any, string | JSXElementConstructor<any>> |
| Description | Cells to be placed in the head of the table. Never put controls, like links and buttons in the table header. Each element in the head creates a new column. |
|---|---|
| Type | HeadType |
| Description | Use this to set if the row will be highlighted. Never use highlighted rows to indicate that a person has selected or focused on the row. |
|---|---|
| Type | number | number[] |
| Description | Use this to force columns to use their initial width regardless of the size of the content that loads in. |
|---|---|
| Type | boolean |
| Description | Displays a loading spinner overlaid on top of the current page. |
|---|---|
| Type | boolean |
| Description | Use this to enable drag and drop sorting of table rows. |
|---|---|
| Type | boolean |
| Description | Disables being able to drop rows on the table.
We recommend using |
|---|---|
| Type | boolean |
| Description | If you don’t use a caption, then you’ll need to use label to describe the table for assistive technologies. Avoid using both at the same time as they may conflict. Rather than a screen reader speaking "Entering table", passing in an label allows a custom message like "Entering Jira work items table". |
|---|---|
| Type | string |
| Description | Use this to set a label for assistive technology that describes the loading state. The default label is "Loading table". You can customize this to be more specific to your table, for example “Loading work items table”. |
|---|---|
| Type | string |
| Description | Configuration of the loading spinner shown when |
|---|---|
| Type | "small" | "large" |
| Description | A callback that happens when the rows displayed on a page have changed. |
|---|---|
| Type | (pageRows: RowType[]) => void |
| Description | A callback that happens when a drop of a row has completed. |
|---|---|
| Type | (rankEnd: RankEnd) => void |
| Description | A callback that happens when a drag of a row has started. |
|---|---|
| Type | (rankStart: RankStart) => void |
| Description | A callback that happens when the table page has changed. |
|---|---|
| Type | (page: number, UIAnalyticsEvent?: UIAnalyticsEvent) => void |
| Description | A callback that happens when a column heading has been sorted. Use this to provide custom sorting. |
|---|---|
| Type | (data: any, UIAnalyticsEvent?: UIAnalyticsEvent) => void |
| Description | Page the table should show. |
|---|---|
| Type | number |
| Description | Labels for the previous and next buttons used in pagination.
Defaults to |
|---|---|
| Type | I18nShape |
| Description | No description. |
|---|---|
| Type | ((instance: any) => void) | RefObject<any> |
| Description | Rows to be placed in the table.
Each row contains cells which should map to the ones defined in the head.
Rows accept standard HTML <tr> props in addition to those listed below.
Ensure each cell has a unique |
|---|---|
| Type | RowType[] |
| Description | Use this to control how many rows should be displayed per page. If the number of rows exceed one page, this will enable pagination. |
|---|---|
| Type | number |
| Description | Column key that the rows should be sorted by.
Corresponds to the |
|---|---|
| Type | string |
| Description | Column sort order. |
|---|---|
| Type | "ASC" | "DESC" |
| Description | A
|
|---|---|
| Type | string |