Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Advanced Table Expand Collapse All Documentation #2748

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ Sticky headers keep column labels visible while scrolling, aiding navigation in

![](/assets/components/table/advanced-table/advanced-table-sticky-header.png)


### Expandable rows

Expandable rows let users show or hide more content without navigating away from the table. The expanded content should align with the header labels, even if the parent row includes minimal data.
Expand All @@ -167,7 +168,54 @@ Avoid using different density settings for parent and child rows.

!!!

### Expand/Collapse All Control

#### Button Behavior

The button expands first unless all rows have already been expanded, and then it switches to Collapse All.
- Manual expanding/collapsing does not change the button state.
- If users collapse rows individually, the button stays Expand All until all rows are collapsed.

#### Interactions

#### Default State

The table can load with any combination of expanded or collapsed rows.
The button reflects the initial state:
- Expand All if any rows are collapsed.
- Collapse All if all rows are expanded.

#### Expanding All Rows

Clicking Expand All expands everything, including nested rows.
- The button updates to Collapse All.

#### Mixed State

Some rows are expanded while others are collapsed.
The button stays Expand All, as its following action will expand all collapsed rows.
- Clicking Expand All in this state expands everything and updates the button to Collapse All.
Expanding from a Mixed State
- Clicking Expand All expands all rows, including manually collapsed ones.
- The button updates to Collapse All.

#### Button States

The button updates based on the current expansion state of the table:

- Expand All will display when all rows are collapsed.

![](/assets/components/table/advanced-table/expandable-rows-collapsed-state.png)

- Collapse All will display when all rows are expanded.

![](/assets/components/table/advanced-table/expandable-rows-expanded-state.png)

- Mixed State displays when some, but not all, rows are expanded.

![](/assets/components/table/advanced-table/expandable-rows-mixed-state.png)
<Doc::ImageCaption @text="The mixed state provides a visual cue that expansion states vary within the table. Selecting the button in this state expands all rows.
"/> -->
### Striping

!!! Info
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.