> ## Documentation Index
> Fetch the complete documentation index at: https://learn.nextedy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Configure Collapsible Groups

> Organize related columns into collapsible groups in your Nextedy POWERSHEET sheet configuration so users can expand or collapse entire sections of columns to focus on what matters.

export const LastReviewed = ({date}) => {
  if (!date) return null;
  const formatted = new Date(`${date}T00:00:00Z`).toLocaleDateString("en-US", {
    year: "numeric",
    month: "long",
    day: "numeric",
    timeZone: "UTC"
  });
  return <p className="mt-10 text-sm text-gray-400 dark:text-zinc-500 not-prose">
      Last reviewed on {formatted}
    </p>;
};

## Prerequisites

* A working sheet configuration with multiple columns defined
* Familiarity with [column groups](/powersheet/guides/sheet-configuration/configure-column-group)

<Steps>
  <Step title="Define Column Groups with Collapse Targets">
    In your sheet configuration YAML, add a `columnGroups` section. For each group that should be collapsible, specify the `collapseTo` property pointing to the column that remains visible when the group is collapsed.

    ```yaml theme={null}
    columnGroups:
      Requirements:
        groupName: Requirements
        groupStyle: blue
        headerStyle: blue
        collapseTo: systemRequirements.systemRequirement.title
      Risks:
        groupName: Risks
        groupStyle: orange
        headerStyle: orange
        collapseTo: hazards.hazard.title
    ```

    The `collapseTo` value must be a valid binding path of a column that belongs to the same group.
  </Step>

  <Step title="Assign Columns to Groups">
    Each column that should participate in a collapsible group needs a `columnGroup` property matching the group key:

    ```yaml theme={null}
    columns:
      systemRequirements.systemRequirement.title:
        title: Sys Req Title
        width: 200
        columnGroup: Requirements
        hasFocus: true
      systemRequirements.systemRequirement.severity:
        title: Severity
        width: 100
        columnGroup: Requirements
      systemRequirements.systemRequirement.status:
        title: Status
        width: 100
        columnGroup: Requirements
    ```

    When the **Requirements** group is collapsed, only the `systemRequirements.systemRequirement.title` column remains visible because it matches the `collapseTo` path.
  </Step>

  <Step title="Understand the Collapse Behavior">
    <Frame>
      <img src="https://mintcdn.com/none-17b4493f/-WiVljKlDztH36bB/powersheet/diagrams/guides/sheet-configuration/configure-collapsible-groups/diagram-1.svg?fit=max&auto=format&n=-WiVljKlDztH36bB&q=85&s=78c1022ca7224581d0e84d08bc008c95" alt="diagram" style={{ width: "520px", maxWidth: "100%" }} width="520" height="180" data-path="powersheet/diagrams/guides/sheet-configuration/configure-collapsible-groups/diagram-1.svg" />
    </Frame>

    The group header row displays a toggle button when `collapseTo` is configured. Clicking the button hides all columns in the group except the designated collapse target column. Clicking the toggle again expands the group back to its full column set.

    <Note title="Groups without collapseTo">
      If a column group does not define `collapseTo`, no collapse toggle button appears in the group header. The group still provides visual organization but cannot be collapsed.
    </Note>
  </Step>

  <Step title="Handle Columns Without a Group">
    Columns that are not assigned to any `columnGroup` still display correctly. They appear with a blank group header cell, maintaining the consistent two-row header structure across the entire sheet.

    <Warning title="Collapse target must belong to the group">
      The column referenced by `collapseTo` must have its `columnGroup` set to the same group. If the column path does not match any column in the group, the collapse button may not appear or may behave unexpectedly.
    </Warning>

    <Tip title="Use collapseTo for summary columns">
      Choose a column that provides the best summary when the group is collapsed -- typically the primary identifier such as `title` or `id`. This lets users scan the sheet efficiently without expanding every group.
    </Tip>
  </Step>

  <Step title="Combine with Row Grouping">
    Collapsible column groups work independently from row grouping. You can combine both features:

    * **Column groups** collapse columns horizontally (hiding detail columns)
    * **Row grouping** collapses rows vertically (using `groupBy` on a column or keyboard shortcuts `Ctrl+G` / `Ctrl+Shift+G`)
  </Step>
</Steps>

## Verification

After saving the configuration and reloading the powersheet document:

1. You should now see group headers spanning multiple columns with the group name displayed
2. Groups with `collapseTo` defined should show a toggle button in the group header
3. Clicking the toggle should hide all columns except the collapse target
4. Clicking again should restore all columns in the group

## See Also

* [Configure a Column Group](/powersheet/guides/sheet-configuration/configure-column-group) -- set up basic column grouping with styling
* [Add a Column](/powersheet/guides/sheet-configuration/add-column) -- add individual columns to your sheet configuration
* [Add a Column](/powersheet/guides/sheet-configuration/add-column) -- column sizing and configuration
* [Create a View](/powersheet/guides/sheet-configuration/create-view) -- create named views with different column visibility presets

<LastReviewed date="2026-07-02" />
