-
-
Notifications
You must be signed in to change notification settings - Fork 208
Open
Copy link
Description
What problem does this feature solve?
It would be useful to have an option for accordion-style sidebar behavior where expanding one section automatically collapses others.
For documentation sites with many sidebar sections (e.g., multiple products or large changelogs), the sidebar can become very long when multiple sections are expanded. Accordion mode would keep the sidebar compact and focused.
What does the proposed API look like?
// In rspress.config.ts
themeConfig: {
sidebar: {
accordion: true, // Only one section expanded at a time
}
}…or per-path:
sidebar: {
'/docs/': {
accordion: true,
items: [...]
}
}Alternatives considered:
- CSS/JS manipulation in custom theme - doesn't persist because Rspress manages sidebar state internally
- Always starting sections collapsed (collapsed: true) - requires manual expand each time, poor UX
Prior art:
- https://getbootstrap.com/docs/5.3/components/accordion/ - uses data-bs-parent attribute
- [Accordion] shows only one expanded section at a time carbon-design-system/carbon#2141 - similar feature request
Reactions are currently unavailable
Metadata
Metadata
Labels
No labels