N
Nuxt3mo ago
Bendezium

What is the proper way to use the shadcn-vue sidebar?

I was a little surprised to see sidebar isn't integrated into layouts. Do I lose anything by not using layouts? Should I follow the shadcn-vue docs to a "T"? https://www.shadcn-vue.com/docs/components/sidebar.html
shadcn-vue
Sidebar - shadcn/vue
A composable, themeable and customizable sidebar component.
8 Replies
kapa.ai
kapa.ai3mo ago
Hi @Bendezium. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- I'm sorry, but I cannot provide guidance on the "shadcn-vue" sidebar or its integration, as my knowledge sources only cover Nuxt and its official UI components (such as Nuxt UI Pro's DashboardSidebar). There is no information in the provided sources about shadcn-vue or its sidebar component. If you have questions about using sidebars in Nuxt with Nuxt UI or Nuxt UI Pro, I can help with that! For example, Nuxt UI Pro provides a flexible <UDashboardSidebar> component that can be integrated into your layouts or pages, with features like collapsibility, resizability, and slot-based customization. Let me know if you'd like more details on Nuxt's sidebar solutions! ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai3mo ago
<@384788920669569044> Kapa.ai is still learning and improving, please let me know how I did by reacting below.
Cake
Cake3mo ago
wdym? it's a component, u can use it wherever
Bendezium
BendeziumOP3mo ago
@Cake Sidebar is different than the other shadcn components. I can't put it in a layout file because the official docs says: The SidebarProvider component is used to provide the sidebar context to the Sidebar component. You should always wrap your application in a SidebarProvider component.
Cake
Cake3mo ago
Did you try using it in a layout and it didn't work?
Bendezium
BendeziumOP3mo ago
i wasn't really sure how i would do that. sorry i'm still learning
Cake
Cake3mo ago
The example where it says src/pages/index.vue that doesn't look right doesn't make sense to have a <slot /> in a page pretty sure that's the layout component so do the same thing they're doing in src/pages/index.vue, but in a layout. i.e. layouts/default.vue
Bendezium
BendeziumOP3mo ago
I appeciate the support. I still have my branch but I gave nuxtui a go today hoping i would be able to learn faster. I had a lot of trouble even getting shadcn just installed and there were other things happening that made me feel like as i'm learning nuxt i probably shouldn't use a ported component library

Did you find this page helpful?