You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I am just starting to use rapidoc with our APIs and I am trying to add it as a page inside of our website.
Unfortunately this website has a floating scrollbar. So when a user clicks on an endpoint and rapidoc scrolls to the top of that element, the floating header is covering the element. I think what I need is a feature similar to the redoc's 'scroll-y-offset'. So when it does scroll to an element it adds an amount to that scroll position.
Does this feature exist in Rapidoc? Or is there another/better way to do this?
I saw in other git issues the suggestion is to add padding to the parent div of the redoc web element. I am doing this so that the documentation isn't covered by the header, but it still scrolls to the same place. Maybe I am doing this wrong?
Took me a while, but this came through as a hack that worked consistently for me.
RapiDoc doesn't have a built-in scroll-y-offset like ReDoc, but wrapping it in a container with controlled height and overflow does the job, especially when dealing with a fixed or floating header.
Here’s what worked in my setup (using Next.js + TypeScript):
<divclassName="w-full h-screen px-4 py-4">{/* @ts-expect-error: RapiDoc is a custom element not known to TypeScript */}<rapi-docspec-url={specUrl}theme="light"render-style="read"show-header="false"allow-spec-url-load="false"allow-spec-file-load="false"allow-spec-url-download="false"style={{height: '100%',width: '100%',overflow: 'auto',display: 'block',}}/></div>
This ensures:
Full-height scrollable documentation
No interference from fixed headers or parent container styles
Clean integration inside a React layout
Hopefully helpful to others running into similar scroll behavior issues! 🚀
Activity
preston-56 commentedon Jul 8, 2025
@ImperviousPanda was it ever fixed? I'm reproducing the same blocker
preston-56 commentedon Jul 8, 2025
@ImperviousPanda
Took me a while, but this came through as a hack that worked consistently for me.
RapiDoc doesn't have a built-in
scroll-y-offsetlike ReDoc, but wrapping it in a container with controlled height andoverflowdoes the job, especially when dealing with a fixed or floating header.Here’s what worked in my setup (using Next.js + TypeScript):
This ensures:
Full-height scrollable documentation
No interference from fixed headers or parent container styles
Clean integration inside a React layout
Hopefully helpful to others running into similar scroll behavior issues! 🚀