question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support activeBasePath and activeBaseRegex for Navbar dropdowns

See original GitHub issue

🚀 Feature

Allow setting of activeBasePath and activeBaseRegex on dropdown items for the navbar so the dropdown becomes highlighted when the user is in that particular section of the docs.

Motivation

activeBasePath and activeBaseRegex are very useful for signalling to the user what section of the docs they are on.

However, this doesn’t work for dropdowns. This reduces the immediate helpfulness when moving from a flat navbar structure to a slightly more nested one. See example:

Before: Screen Shot 2020-07-15 at 2 52 22 PM

After: Screen Shot 2020-07-15 at 2 52 32 PM

Have you read the Contributing Guidelines on issues?

Yes

Pitch

If we implemented this feature, then the user will have a clear signal as to what section of the docs they are on, regardless of whether or not they were hovering over a specific dropdown. Of course, you can simply opt-out of this feature by not using activeBasePath and activeBaseRegex in the dropdown.

Example usage:

{
  label: "The Protocol",
  position: "left",
  activeBaseRegex: "(synthetic-tokens|oracle/|governance/)",
  items: [
    {
      to: "synthetic-tokens/explainer",
      label: "Synthetic Tokens",
      activeBasePath: "synthetic-tokens",
    },
    {
      to: "oracle/tech-architecture",
      label: "Oracle (DVM)",
      activeBaseRegex: "(oracle/|governance/)",
    },
  ],
},

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
adrianmclicommented, Aug 12, 2020

@slorber thanks so much for the clarification! perhaps it should be documented better, but I really appreciate you taking the time 😊

0reactions
slorbercommented, Aug 12, 2020

np 👍

i’d like to improve all that as it’s not idiomatic at all

keeping this undocumented also helps to see how many users are struggling with this kind of issues 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Theme configuration - Docusaurus
activeBaseRegex is a more flexible alternative to activeBasePath ... Navbar dropdown items only accept the following "link-like" item types:.
Read more >
Nav bar usage | Lavender Spacecraft
activeBaseRegex is a more flexible alternative to activeBasePath and takes precedence ... Navbar items can also be dropdown items by specifying the items ......
Read more >
How To Create a Dropdown Navigation Bar - W3Schools
Create a dropdown menu that appears when the user moves the mouse over an element inside a navigation bar. Step 1) Add HTML:...
Read more >
Easy documentation with Docusaurus - LogRocket Blog
It generates a static React.js website using MDX and has support ... a dropdown { label: versions[0], to: "docs/", activeBaseRegex: `docs/(?
Read more >
Bootstrap navbar dropdown hidden behind bootstrap slider
remove the overflow:hidden from your nav-bar class. I hope this will help you. .nav-bar { list-style-type: none; margin: 0; padding: 0; }.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found