Skip to content

docs(accordion): add nested accordion example#42363

Open
stafferin wants to merge 1 commit intotwbs:mainfrom
stafferin:docs-nested-accordion-example
Open

docs(accordion): add nested accordion example#42363
stafferin wants to merge 1 commit intotwbs:mainfrom
stafferin:docs-nested-accordion-example

Conversation

@stafferin
Copy link
Copy Markdown

Summary

Adds a "Nested" subsection to the Accordion docs page with a working example of an accordion nested inside another accordion's body. The example highlights the key gotcha: the nested .accordion-collapse elements must use data-bs-parent pointing at the nested container, not the outer one, so opening/closing nested items doesn't affect the parent accordion.

Closes #41895.

Test plan

  • Build the docs site (npm run docs-serve) and visit the Accordion page
  • Confirm the new "Nested" example renders between "Always open" and "Accessibility"
  • Confirm parent items still toggle independently of nested items, and vice versa

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.

Add an example of using the nested Collapse component

1 participant