Skip to content
Discussion options

You must be logged in to vote

Hey, the AppSidebar must be wrapped inside a SidebarProvider, the provider handles the collapsible state. You can refer to this diagram for the way sidebar is structured:

Its from the sidebar documentation: https://ui.shadcn.com/docs/components/sidebar
If you scroll down below in this documentation you can see an example of AppSidebar usage:

import { SidebarProvider, SidebarTrigger } from "@/components/ui/sidebar"
import { AppSidebar } from "@/components/app-sidebar"

export default function Layout({ children }: { children: React.ReactNode }) {
  return (
    <SidebarProvider>
      <AppSidebar />
      <main>
        <SidebarTrigger />
        {children}
      </main>
    </SidebarProvider

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@atterattgdsn
Comment options

Answer selected by atterattgdsn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants