Uh oh!
There was an error while loading. Please reload this page.
feat(sidebar): add collapsible root sidebar groups - #2784
Conversation
@sy-records is attempting to deploy a commit to the Docsify Team on Vercel. A member of the Team first needs to authorize it. |
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Thanks for taking this long-requested feature on @sy-records !
Here is my test sandbox:
https://codesandbox.io/p/devbox/vibrant-brattain-hj7935
I am concerned that the introduction of using bold to mark new expandable/collapsible sections might be confusing for users and add visual complexity to the sidebar.

One alternative would be to use the existing Chevron indicators to show expandable/collapsible sections (with existing rotation behavior), and do so without little additional visual complexity. Here is a quick mockup:

What do you think?
You might also find this closed issue a helpful reference @sy-records : #1564 I am not suggesting additional functionality at this point, but the comment by jhildenbiddle was also quite insightful for future consideration re: initial expaned/collapsed state. |
sy-records
commented
Aug 13, 2026
The bold text represents the original logic; now it simply supports clicking to expand or collapse it and marks its status so you don’t have to click repeatedly when viewing it. Using a V-shaped indicator will change the current style. |
paulhibbitts
commented
Aug 13, 2026
I am not sure I follow, if bold text is used, and is also in multiple locations, this will likely be confusing for users re: cue of feedback. If I understand correctly possible, I suggest we use the established chevon feedback which is also used by other similar sidebar navs like Docusaurus https://docusaurus.io/docs/category/guides. If bold is only possible I suggest setting aside this feature as the downsides would outweigh the possible upsides to me. |
sy-records
commented
Aug 13, 2026
I added logic to the sidebar-chevron. |
Oh that is starting to work much better @sy-records ! Sorry if I was not specific enough before but along with adding the Chevrons would be removing the bold styling. Once that is done, manually collapsible items will have a visual cue that they can expand/collapse and have the exact same style of the other items present in the sidebar as to not give any confusing feedback. This is going to be a great new feature! |
sy-records
commented
Aug 13, 2026
My previous idea was to keep it, because it comes from the style of v4 and v5, which is just to add an unfolding and folding function. |
I am not sure for what context that style was used before (do you have an example?), but using it with the new expand/collapse feature does not seem to fit that well. I have not seen bold used in tandem with an expand/collapse behaviour. Your addition of the chevrons works really well - could you give removing the bold a try and see how it looks/works? I think it should really unify the visual/UX design 🙂 |
There was a problem hiding this comment.
Thanks for the additional information and context @sy-records , I did not realize the relationship to sidebar group titles - your screenshot was very helpful! Now that I see that, and there is an option to not bold as well, this combined chevron + optional bold approach looks good to me!
paulhibbitts
left a comment
There was a problem hiding this comment.
Thanks for the additional information and context @sy-records , I did not realize the relationship to sidebar group titles - your screenshot was very helpful! Now that I see that, and there is an option to not bold as well, this combined chevron + optional bold approach looks good to me!
This comment was marked as outdated.
This comment was marked as outdated.
Thanks very much @sy-records , this is looking very good! I've updated the sandbox to now use group boxes and use the CSS var you shared to unbold the titles - and added more dummy menu items: https://codesandbox.io/p/sandbox/black-https-hj7935 This made me remember an previous Docsify v4 site I created with John Hildenbiddle's Themeable which I have now converted over to v5, where I "hacked" together collapsible sidebar items for a site with a fair number of pages: https://docs.hibbittsdesign.org/#/ You can see that it is quite valuable to be be able to also set all items as collapsed to provide a nice UX for someone to first pick a high-level category, and then explore related items etc. This made me regret my earlier comment about not considering setting the initial collapsed state for collapsible items, seen in PR 1563 🫤 Any possible options here from your viewpoint? Thanks very much! |
paulhibbitts
commented
Aug 17, 2026
Your new config to set all sidebar groups to be initially collapsed is awesome @sy-records! One small naming suggestion though, collapseSidebar reads a bit ambiguous next to the existing hideSidebar option, since both could be read as affecting the whole sidebar panel. Since everywhere else in the implementation uses "group" (.group-title, data-group-id, #toggleSidebarGroup()), how about collapseSidebarGroups instead? |
paulhibbitts
left a comment
There was a problem hiding this comment.
This is looking great @sy-records , here is the updated CodeSandbox with the latest PR Preview Build and as well testing the ability to set collapseSidebarGroups to true:
https://codesandbox.io/p/sandbox/black-https-hj7935
All is looking good!
Uh oh!
There was an error while loading. Please reload this page.
Hi @sy-records , not sure if this is the best place or I should create a new issue for this - let me know! I am starting to use the newest Docsify preview with my own Docsify-This test site, and have already run across some unintended consequences of the new collapsible sidebar being automatically applied, for example: Note the bold group titles and new chevron icons appearing automatically, with no action taken by the user - this is of concern as we don't want to start changing the design of Docsify sites with no user confirmation/action. Perhaps could we add a new config, set to Alternatively, and I think the better long-term design, adopting the syntax @jhildenbiddle suggested in #1564 would also result in no change without user opt-in, and would remove the need for a config option altogether - both the already-shipped I was not able to foresee this until I started to try out more possible Docsify test setups via Docsify-This. Looking forward to hearing your thoughts, thanks very much Paul. |
Can you share the link? My original idea for this feature was simply to allow the root sidebar to be collapsed and expanded without adding a chevron icon. That way, it would essentially be a hidden feature for users and wouldn't affect them in any way. If the user doesn't want it, they can set |
sy-records
commented
Aug 21, 2026
Hi @sy-records , the issue is more the unexpected change of previously non-bold items to bold. The addition of chevrons is also a visual change, but less noticeable. I reverted the collapsible sidebar group commit from my sync repo used for Docsify-This for this reason. Having done that, now I can use the Docsify-This production build vs. my preview build to show you before and afters. Docsify-This without collapsible sidebar groups: Docsify-This Preview with collapsible sidebar groups: As you can see, the now collapsible items are bold, which changes the visual appearance of Topic 3 with no user choice to do so. Chevrons are also added to two items, which is not ideal either but less of a visual change. I hope the above very simple example shows the issue of unrequested changes happening to a user's docsify site. If a feature will change the visual design and behavior of a site we should make it opt-in, so no action will result in no site changes. Possible ways to opt-in to this feature might be an additional config (i.e. Looking forward to hearing your thoughts, and anyone else here to chime in! PS: For additional references, here is how several other doc generators handle this same situation: |
sy-records
commented
Aug 22, 2026
You can try #2790. There are quite a few configuration options, so I'm using class names to distinguish them. |
Thanks @sy-records , #2790 is a great step forward and solves the bold styling issue well! That said, I'd still like to advocate for a fully opt-in approach, where no visual or behavioral changes happen unless a user explicitly chooses them - even with #2790, clicking now does something new on upgrade with no action taken, and there's still no way to fully disable the feature itself, only its visual presentation. In other words, a Docsify site with this additional feature should look and work identical to the current release UNTIL the user enables the new collapsible sidebar ability. I think the earlier proposed |
sy-records
commented
Aug 24, 2026
That's fine with me; I added |
paulhibbitts
commented
Aug 24, 2026
Awesome, thank you @sy-records - this new feature is looking really great 🙏🏻 |




Summary
Related issue, if any:
Fixes#900
What kind of change does this PR introduce?
For any code change,
Does this PR introduce a breaking change?
Tested in the following browsers: