From a975c43516de4775eafeb44df3c60149de30bdc0 Mon Sep 17 00:00:00 2001 From: Alex Haslam Date: Sat, 31 Jan 2026 19:59:38 +0000 Subject: [PATCH] Add example with collapse mode --- exampleSite/content/docs/shortcodes/index.md | 26 +++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/exampleSite/content/docs/shortcodes/index.md b/exampleSite/content/docs/shortcodes/index.md index 92355f29..47dee3fa 100644 --- a/exampleSite/content/docs/shortcodes/index.md +++ b/exampleSite/content/docs/shortcodes/index.md @@ -116,7 +116,7 @@ The alert sign (`+` or `-`) is optional to control whether the admonition is fol | `header` | **Optional.** Alias for `title`, kept for compatibility with other shortcodes. | -**Example:** +**Example 1: `mode="open"` (multiple items can be open)** ```md {{}} @@ -140,6 +140,30 @@ The alert sign (`+` or `-`) is optional to control whether the admonition is fol {{< /accordionItem >}} {{< /accordion >}} +**Example 2: `mode="collapse"` (only one item open at a time)** + +```md +{{}} + {{}} + First item content. + {{}} + + {{}} + Second item content. + {{}} +{{}} +``` + +{{< accordion mode="collapse" >}} + {{< accordionItem title="First item" open=true >}} + First item content. + {{< /accordionItem >}} + + {{< accordionItem title="Second item" >}} + Second item content. + {{< /accordionItem >}} +{{< /accordion >}} +


## Article