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.