fuma-nama / fumadocs

The beautiful docs framework for Next.js. Alternative to Nextra
https://fumadocs.vercel.app
MIT License
1.43k stars 83 forks source link

Ability to always show the top navbar? #870

Closed akshatmittal closed 1 week ago

akshatmittal commented 2 weeks ago

What problem will this feature address?

I'd like to keep the top nav (full width) on all pages and not just the Home Layout, while using the Sidebar on Docs Layout for navigating between pages.

Describe the solution you'd like

Sort of a prop on HomeLayout to always keep the top nav even in child layouts.

Describe alternatives you've considered

At the moment, I just have a custom component that I add to the DocsLayout pages at the top, but this isn't ideal since it's completely disjoint from the rest of the app.

Additional context

No response

fuma-nama commented 2 weeks ago

As the major change of Fumadocs v13, I haven't considered to make the previous layout available via options.

Most components are designed for the new layout only, it requires some work and I have to lower the effort to maintain our codebase first (e.g. some CSS variables to calculate layout top).

It won't be considered until the v14 release is ready (with completed docs and blog), so we can roll it out as a minor change later.

akshatmittal commented 2 weeks ago

I see, honestly that makes sense. Do you have any idea of when v14 would be ready? I don't want to maintain a fork of Fumadocs if I can avoid it. (I can actually look into the code and see if I can PR this change if you're open to it, because you mentioned refactoring certain things)

fuma-nama commented 2 weeks ago

After Next.js 15

akshatmittal commented 2 weeks ago

Got it, so that's at least 2 months away. Thanks for responding!

And just to confirm, you have no intention to enable the layout in the current version because it's going to be quite a bit of work to enable it, right? If so, might just have to maintain a fork for if I do a dirty version.

fuma-nama commented 2 weeks ago

Yes, but also notice that we are doing a major change so breaking changes may happen.

akshatmittal commented 2 weeks ago

Oof, now I don't know what to do 😂

fuma-nama commented 1 week ago

I decided to expose a fd-navbar-height CSS variable which you can change it to ensure the layout fits your custom navbar.

You can place your custom navbar at the top of layout, or replacing the default navbar with your custom one. React Contexts of sidebar and search dialog are exported from fumadocs-ui/provider.

akshatmittal commented 1 week ago

Nice, I see it's in the dev branch so I'm assuming it's slated for v14.