From 2aedf0fc71d24c7aafc4eb68fb4beb18c5126499 Mon Sep 17 00:00:00 2001 From: stafferin Date: Sun, 26 Apr 2026 22:08:09 -0400 Subject: [PATCH] docs(accordion): add nested accordion example Closes #41895 --- .../src/content/docs/components/accordion.mdx | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/site/src/content/docs/components/accordion.mdx b/site/src/content/docs/components/accordion.mdx index e8df6d88b625..6bdbb7f54e82 100644 --- a/site/src/content/docs/components/accordion.mdx +++ b/site/src/content/docs/components/accordion.mdx @@ -140,6 +140,63 @@ Omit the `data-bs-parent` attribute on each `.accordion-collapse` to make accord `} /> +### Nested + +Accordions can be nested by placing one accordion inside the `.accordion-body` of another. The `data-bs-parent` attribute on the nested `.accordion-collapse` elements must reference the nested accordion’s container (not the outer one), so that opening or closing nested items doesn’t affect the parent accordion’s state. + + +
+

+ +

+
+
+ This is the first parent item’s accordion body. It contains another, nested accordion. +
+
+

+ +

+
+
+ This is the first nested item’s accordion body. Note how its data-bs-parent targets the nested accordion, not the outer one. +
+
+
+
+

+ +

+
+
+ This is the second nested item’s accordion body. +
+
+
+
+
+
+
+
+

+ +

+
+
+ This is the second parent item’s accordion body. +
+
+
+ `} /> + ## Accessibility Please read the [collapse accessibility section]([[docsref:/components/collapse#accessibility]]) for more information.