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
8 Replies
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:
----------------------<@384788920669569044> Kapa.ai is still learning and improving, please let me know how I did by reacting below.
wdym? it's a component, u can use it wherever
@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.
Did you try using it in a layout and it didn't work?
i wasn't really sure how i would do that.
sorry i'm still learning
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
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