facebook / facebook/docusaurus

Persist sidebar state (categories expanded state, hidden sidebar)

Open
#6,319 2 comments 0 reactions 0 assignees View on GitHub
domain: theme feature
Dominant language
TypeScript
Stars
66.2k
Forks
10k
Avg merge
1d 3h
Merged PRs (30d)
52

Description

### Have you read the Contributing Guidelines on issues?

- [X] I have read the [Contributing Guidelines on issues](https://github.com/facebook/docusaurus/blob/main/CONTRIBUTING.md#reporting-new-issues).

### Description

It would be useful to persist sidebar state like which categories are collapsed and if the sidebar is hidden or not in local storage (or session storage?), so that the user's navigation experience is not interrupted by, say, going to the blog briefly.

### Has this been requested on Canny?

No

### Motivation

Better UX

### API design

Persist state in local storage / session storage and retrieve on sidebar first render. After #3811 we probably have a better way to control the collapsed state of individual categories.

### Have you tried building it?

No

### Self-service

- [ ] I'd be willing to contribute this feature to Docusaurus myself.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.