How to Add Drawer with Navigation bar without bottom extra space #3122
-
As you've seen in the below URL, I'm trying to disable scrolling. When I add a drawer, the entire page scrolls because I've included a navbar (header). However, I want only the content to scroll, not the entire screen. What am I missing here? |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 1 reply
-
Pur the navbar inside https://daisyui.com/components/drawer/#drawer-tags-structure |
Beta Was this translation helpful? Give feedback.
-
Hey @saadeghi, When I followed your approach and placed the Navbar inside |
Beta Was this translation helpful? Give feedback.
-
Remove |
Beta Was this translation helpful? Give feedback.
-
Hey @saadeghi, As you can see in the screenshot, when I remove the When I add a top bar above the drawer, I notice there's extra space at the bottom equivalent to the menu height. How to remove this extra space? |
Beta Was this translation helpful? Give feedback.
In that case, if you want the navbar on top of the sidebar as well here are the changes you need to make:
<main class="min-h-screen">
navbar
out ofdrawer
. I initially told you to put it inside, because I didn't know you want the navbar on top of the sidebar as well (thanks for the screenshot)h-[calc(100vh-4rem)] top-16
todrawer-side
because your navbar is sticky and you won't want the sidebar to go under the navbar.flex h-full flex-col overflow-auto
. You don't need any of them. Addmin-h-full
so your menu covers the height.Here's the fixed version:
https://play.tailwindcss.com/hzj8ex41Uf?size=1088x699