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:
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?
…or per-path:
Alternatives considered:
Prior art: