[v2] Option to toggle docs category open by default
See original GitHub issue🚀 Feature
Add a new property on the @docusaurus/plugin-content-docs SidebarItemCategory to set the default state as opened. This should affect only to that one category, no all the categories on the docs.
Have you read the Contributing Guidelines on issues?
Yes.
Motivation
Improve UX.
Pitch
Imagine docs with just two root elements:
- Introduction
- Reference v
Where Reference is a category with few other documents inside. This would allow to have this Reference category open by default which would be easier for the user to navigate/explore.
Issue Analytics
- State:
- Created 4 years ago
- Comments:34 (32 by maintainers)
Top Results From Across the Web
Sidebar - Docusaurus
The themeConfig.docs.sidebar.autoCollapseCategories option would collapse all sibling categories when expanding one category. This saves the ...
Read more >How to Display Specific Video Category Tab as a Default on ...
The setting can be found under the Video > Filterable Tabs > Default Tab on Page Load. Choose option Custom and enter a...
Read more >Word Options (Advanced) - Microsoft Support
Among the options in this section, you can change where Word saves your changes by selecting File Locations . Or choose to open...
Read more >.toggle() | jQuery API Documentation
A map of additional options to pass to the method. duration (default: 400 ). Type: Number or String. A string or number determining...
Read more >Viewing PDFs and viewing preferences, Adobe Acrobat
2 ) You have the option Restore Last View Settings When Reopening Documents selected in Edit > Preferences > Document category. Resolution. Use ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@jsjoeio in short, this line of code does not need to be changed. I would add an additional condition under which item must be expanded.
https://github.com/facebook/docusaurus/blob/510bec65325dcada1c14627910087d29749b16d5/packages/docusaurus-theme-classic/src/theme/DocSidebar/index.js#L109
Please see the docs https://v2.docusaurus.io/docs/next/docs#collapsible-categories
I recommend checking the changes directly on the v2 website, rather than creating a new one.
Other than that, you don’t need to use Verdaccio for such changes at all, it only takes more effort from you. The workflow is described here https://github.com/facebook/docusaurus/blob/master/admin/testing-changes-on-Docusaurus-itself.md#testing It is very simple.
Not sure if this really improves ux.
If I’m a new user to the site and by default the references section is open, I’d probably find it confusing because I need to know the introduction docs first before getting into other details.
The scenario mentioned in the original post is probably an example but it feels more like content organization issue rather than needing a feature from the ssg tool.
Docusaurus also lets you create multiple sidebars that contains different navigation. That could also be an option depending the actual use case.