Nuxt UI - Responsive Model/Drawer
Hey guys, how would we implement this responsive model with Nuxt UI.
https://www.shadcn-vue.com/docs/components/drawer.html
2 Replies
Hi @QRST. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
I can help you implement a responsive drawer with Nuxt UI, which is similar to the shadcn-vue drawer component you referenced.
Nuxt UI provides a
UDrawer
component that can be used to create a responsive drawer that slides in from any side of the screen. Here's how you can implement it:
Basic Implementation
Responsive Behavior
To make the drawer responsive, you can use the direction
prop to change the direction based on screen size:
Customizing the Drawer
You can customize the drawer with various props:
Additional Features
Nuxt UI's Drawer component supports:
- Different directions (top, right, bottom, left) Drawer Direction
- Inset mode to create space around the drawer Drawer Inset
- Background scaling for visual depth Drawer Scale Background
- Controlled open state with v-model Drawer Control Open State
For more complex layouts, you might also want to check out the UDashboardSidebar
component which has built-in responsive behavior and can be configured with different modes including drawer mode:
This approach provides a dashboard layout with a sidebar that transforms into a drawer on smaller screens Dashboard Sidebar Mode.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------<@516423579571847168> Kapa.ai is still learning and improving, please let me know how I did by reacting below.