Table tree
A table tree is an expandable table for showing nested hierarchies of information.Installation
| Install | yarn add @atlaskit/table-tree |
|---|---|
| Source | Bitbucket.org, (opens new window) |
| npm | @atlaskit/table-tree, (opens new window) |
| Bundle | unpkg.com, (opens new window) |
Props
Table tree props
| Description | The contents of the table.
Use this when composing |
|---|---|
| Type | string | number | boolean | ReactElement<any, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal |
| Description | Each column component is used to render the cells in that column.
A cell's |
|---|---|
| Type | ElementType<any, keyof IntrinsicElements>[] |
| Description | The widths of the columns in the table. |
|---|---|
| Type | ColumnWidth[] |
| Description | The header text of the columns of the table. |
|---|---|
| Type | string[] |
| Description | The data used to render the table. If you're creating a basic table, use this prop instead of composing cell, header, headers, row, and rows components. |
|---|---|
| Type | Item[] |
| Description | This is an |
|---|---|
| Type | string |
| Description | The value used to extend the expand or collapse button label in cases where |
|---|---|
| Type | string | number |
| Description | This is an |
|---|---|
| Type | string |
| Description | Use this to set whether a row with children should expand when clicked anywhere within the row. If |
|---|---|
| Type | boolean |
Headers props
The Headers component does not take any props.
Header props
| Description | The contents of the header. |
|---|---|
| Type | string | number | boolean | ReactElement<any, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal |
| Description | No description. |
|---|---|
| Type | string |
| Description | No description. |
|---|---|
| Type | () => void |
| Description | No description. |
|---|---|
| Type | string |
| Description | Width of the header item. Takes a string, or a number representing the width in pixels. |
|---|---|
| Type | string | number |
Rows props
| Description | The data used to render the set of rows. Will be passed down via the In addition to these props, any other data can be added to the object, and it will be provided as props when rendering each cell. |
|---|---|
| Type | Item[] |
| Description | This is an accessible name for the loading state's spinner. The default text is "Loading". |
|---|---|
| Type | string |
| Description | Render function for child rows. Render props will contain an item from the
|
|---|---|
| Type | (args: Item & { children?: Item[]; content?: Content; }) => ReactElement<RowProps<Item>, string | JSXElementConstructor<any>> |
Row props
| Description | Children contained in the row. Should be one or more cell components. |
|---|---|
| Type | string | number | boolean | ReactElement<any, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal |
| Description | This is the accessible name for the collapse chevron button, used to tell assistive technology what the button is for. |
|---|---|
| Type | string |
| Description | Data to render. Passed down by |
|---|---|
| Type | Item |
| Description | The depth used for rendering an indent.
This is normally set by parent |
|---|---|
| Type | number |
| Description | This is the accessible name for the expand chevron button, used to tell assistive technology what the button is for. |
|---|---|
| Type | string |
| Description | Whether the row has children. |
|---|---|
| Type | boolean |
| Description | Sets the default expanded state of the row. |
|---|---|
| Type | boolean |
| Description | Controls the expanded state of the row. |
|---|---|
| Type | boolean |
| Description | ID for the row item. |
|---|---|
| Type | string |
| Description | The data used to render the row and descendants. Pass down from |
|---|---|
| Type | Item[] |
| Description | Adds detail to the expand and collapse row button's aria label by appending the value from the given column. If you don't set this prop, the aria label will read out "Expand |
|---|---|
| Type | string | number |
| Description | Callback called when the row collapses. |
|---|---|
| Type | (data: Item, analytics?: UIAnalyticsEvent) => void | Promise<void> |
| Description | Callback called when the row expands. |
|---|---|
| Type | (data: Item, analytics?: UIAnalyticsEvent) => void | Promise<void> |
| Description | Children to render under the row. This is normally set by the parent item component, and doesn't need to be configured. |
|---|---|
| Type | () => ReactNode |
| Description | Use this to set whether a row with children should expand when clicked anywhere within the row. If |
|---|---|
| Type | boolean |
Cell props
| Description | Children content, used when composing a table tree from internal components |
|---|---|
| Type | string | number | boolean | React.ReactElement<any, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | React.ReactPortal |
| Description | Class name to apply to the cell. |
|---|---|
| Type | string |
| Description | No description. |
|---|---|
| Type | number |
| Description | Sets the indent level for the cell. Each indent level adds |
|---|---|
| Type | number |
| Description | Sets whether the cell contents should wrap or display on a single line and be truncated. For accessibility reasons, wrapping the content is strongly recommended. |
|---|---|
| Type | boolean |
| Description | The width of the header item. Takes a string, or a number representing the width in pixels. |
|---|---|
| Type | string | number |