Skip to content
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 @@ -281,6 +281,14 @@ const columns = [
- The PopoverContainer will automatically close when the target row scrolls out of view, preventing orphaned menus
- Modals opened from menu items will use `zIndex={3}` by default to appear above table headers

### Column visibility

`DataTable` does not manage column visibility itself. Keep a full column config, track which keys are visible in local state, and pass the filtered `columns` array into the table. Drive that state from a `PopoverContainer` with a <LinkTo id="Molecules/Menu">Menu</LinkTo> of <LinkTo id="Atoms/FormInputs/Checkbox">Checkbox</LinkTo>es — checked means shown, unchecked means hidden.

Follow the floating-menu pattern: wrap the `Menu` in `<Background bg="background">` for the surface; `PopoverContainer` only positions and does not style. Do not nest a second `Menu` for the checkbox list — nested popover menus get their own border and look double-outlined. Use `Checkbox` `spacing="tight"` for a denser list, and keep at least one identifying column pinned (disable its checkbox) so the table never renders with zero columns.

<Canvas of={DataTableStories.ColumnVisibility} />

## Container Query Control

DataTable inherits container query functionality from the underlying List component. By default, DataTable uses CSS container queries to determine responsive behavior based on the container width rather than viewport width. This ensures optimal display when DataTable is placed in constrained layouts.
Expand Down
Loading
Loading