Skip to content

feat: add trailing action slot to Collapsible - #10

Open
codingwolf-at wants to merge 4 commits into
mainfrom
feat/collapsible-trailing-action
Open

feat: add trailing action slot to Collapsible#10
codingwolf-at wants to merge 4 commits into
mainfrom
feat/collapsible-trailing-action

Conversation

@codingwolf-at

@codingwolf-at codingwolf-at commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Description

Collapsible headers can take a trailing action (for example an add IconButton) on the opposite side of the label/chevron cluster.

The control is a sibling of the trigger, not nested inside it — nested buttons are invalid, and clicking the action must not toggle the panel. Pass it on the ready-made as trailing. Atomic assemblies wrap the trigger in CollapsibleHeader and put the control in CollapsibleTriggerTrailing.

The trigger still packs [icon?][title][chevron] on the start; leftover space stays the toggle hit target. Root disabled does not disable the trailing control.

Type of Change

  • Feature (non-breaking change which adds functionality)
  • Documentation update

Screenshots and Media (if applicable)

Collapsible with trailing action
Screenshot 2026-08-28 at 10 49 02 PM

Test Scenarios

  • Open a Collapsible with trailing (e.g. ghost + IconButton): label + chevron stay clustered on the start, action sits at the inline-end
  • Click the trailing action: panel open state does not change
  • Click the trigger, including the empty space between the chevron and the action: panel still toggles
  • Set Root disabled: trigger will not toggle; trailing action still works unless you disable that control too
  • Tab through the header: two stops (trigger, then trailing action)

- Introduced `trailing` prop to `Collapsible` for rendering a header-end control as a sibling to the trigger.
- Added `CollapsibleHeader` and `CollapsibleTriggerTrailing` components for improved structure and styling.
- Updated stories to demonstrate new trailing action functionality, including interaction tests for the trailing button.
- Enhanced documentation to reflect the new features and usage examples.
…n details

- Added documentation for the new `trailing` prop, allowing for a header-end control.
- Updated examples to demonstrate the usage of `CollapsibleHeader` and `CollapsibleTriggerTrailing`.
- Clarified the behavior of the trailing control and its interaction with the Collapsible component.
@codingwolf-at codingwolf-at self-assigned this Aug 28, 2026
@codingwolf-at codingwolf-at changed the title Feat/collapsible trailing action [WIP] feat: add trailing action slot to Collapsible Aug 28, 2026
`trailing != null` still rendered `CollapsibleTriggerTrailing` for `trailing={false}`
(e.g. `cond && <IconButton/>`), adding an empty end-padded box to the header row.
@codingwolf-at
codingwolf-at force-pushed the feat/collapsible-trailing-action branch from 7777af8 to 0b3d2e6 Compare August 28, 2026 17:27
@codingwolf-at
codingwolf-at marked this pull request as ready for review August 28, 2026 17:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant