Redocly / Redocly/redoc

Add an option to disable the side menu?

Open
#1,271 6 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Type: Enhancement under consideration
Dominant language
TypeScript
Stars
25.9k
Forks
2.4k
Avg merge
13h 10m
Merged PRs (30d)
4

Description

Hi, what do you think about adding an option to disable the side menu (not rendering it to the DOM)?

Rationale:

  • Give users the option to opt out
  • More performant
  • Less issues with scrolling

In my use case, I've been using CSS to hide the side menu as I have other sidebar to show.
And recently, I've bumped into an issue with the scroll (similar to https://github.com/Redocly/redoc/issues/1177), I ended up adding a callback to remove the side menu as it turns out to be the quick-fix:

Redoc.init(spec, {
  disableSearch: true
},
document.querySelector("redoc"),
function() {
  document.querySelector(".menu-content").remove();
});

If we get a greenlight on this, maybe we can work on a PR to make it happen 🙂
Thanks!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Redoc.init configuration shown in the issue and trace how the side menu represented by .menu-content is rendered. Define an option that prevents it from being added to the DOM, while preserving the existing menu behavior when the option is not enabled; verify the resulting rendering and scrolling behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.