sidebar-09.json — ui Source File
Architecture documentation for sidebar-09.json, a json file in the ui codebase.
Entity Profile
Source Code
{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "sidebar-09",
"title": "Sidebar 09",
"description": "Collapsible nested sidebars.",
"registryDependencies": [
"sidebar",
"breadcrumb",
"separator",
"collapsible",
"dropdown-menu",
"avatar",
"switch",
"label"
],
"files": [
{
"path": "registry/radix-vega/blocks/sidebar-09/page.tsx",
"content": "import { AppSidebar } from \"@/registry/radix-vega/blocks/sidebar-09/components/app-sidebar\"\nimport {\n Breadcrumb,\n BreadcrumbItem,\n BreadcrumbLink,\n BreadcrumbList,\n BreadcrumbPage,\n BreadcrumbSeparator,\n} from \"@/registry/radix-vega/ui/breadcrumb\"\nimport { Separator } from \"@/registry/radix-vega/ui/separator\"\nimport {\n SidebarInset,\n SidebarProvider,\n SidebarTrigger,\n} from \"@/registry/radix-vega/ui/sidebar\"\n\nexport default function Page() {\n return (\n <SidebarProvider\n style={\n {\n \"--sidebar-width\": \"350px\",\n } as React.CSSProperties\n }\n >\n <AppSidebar />\n <SidebarInset>\n <header className=\"bg-background sticky top-0 flex shrink-0 items-center gap-2 border-b p-4\">\n <SidebarTrigger className=\"-ml-1\" />\n <Separator\n orientation=\"vertical\"\n className=\"mr-2 data-vertical:h-4 data-vertical:self-auto\"\n />\n <Breadcrumb>\n <BreadcrumbList>\n <BreadcrumbItem className=\"hidden md:block\">\n <BreadcrumbLink href=\"#\">All Inboxes</BreadcrumbLink>\n </BreadcrumbItem>\n <BreadcrumbSeparator className=\"hidden md:block\" />\n <BreadcrumbItem>\n <BreadcrumbPage>Inbox</BreadcrumbPage>\n </BreadcrumbItem>\n </BreadcrumbList>\n </Breadcrumb>\n </header>\n <div className=\"flex flex-1 flex-col gap-4 p-4\">\n {Array.from({ length: 24 }).map((_, index) => (\n <div\n key={index}\n className=\"bg-muted/50 aspect-video h-12 w-full rounded-lg\"\n />\n ))}\n </div>\n </SidebarInset>\n </SidebarProvider>\n )\n}\n",
"type": "registry:page",
"target": "app/dashboard/page.tsx"
},
{
"path": "registry/radix-vega/blocks/sidebar-09/components/app-sidebar.tsx",
"content": "\"use client\"\n\nimport * as React from \"react\"\n\nimport { NavUser } from \"@/registry/radix-vega/blocks/sidebar-09/components/nav-user\"\nimport { Label } from \"@/registry/radix-vega/ui/label\"\nimport {\n Sidebar,\n SidebarContent,\n SidebarFooter,\n SidebarGroup,\n SidebarGroupContent,\n SidebarHeader,\n SidebarInput,\n SidebarMenu,\n SidebarMenuButton,\n SidebarMenuItem,\n useSidebar,\n} from \"@/registry/radix-vega/ui/sidebar\"\nimport { Switch } from \"@/registry/radix-vega/ui/switch\"\nimport { IconPlaceholder } from \"@/app/(create)/components/icon-placeholder\"\n\n// This is sample data\nconst data = {\n user: {\n name: \"shadcn\",\n email: \"m@example.com\",\n avatar: \"/avatars/shadcn.jpg\",\n },\n navMain: [\n {\n title: \"Inbox\",\n url: \"#\",\n icon: (\n <IconPlaceholder\n lucide=\"InboxIcon\"\n tabler=\"IconInbox\"\n hugeicons=\"InboxIcon\"\n phosphor=\"TrayIcon\"\n remixicon=\"RiInboxLine\"\n />\n ),\n isActive: true,\n },\n {\n title: \"Drafts\",\n url: \"#\",\n icon: (\n <IconPlaceholder\n lucide=\"FileIcon\"\n tabler=\"IconFile\"\n hugeicons=\"FileIcon\"\n phosphor=\"FileIcon\"\n remixicon=\"RiFileLine\"\n />\n ),\n isActive: false,\n },\n {\n title: \"Sent\",\n url: \"#\",\n icon: (\n <IconPlaceholder\n lucide=\"SendIcon\"\n tabler=\"IconSend\"\n hugeicons=\"SentIcon\"\n phosphor=\"PaperPlaneTiltIcon\"\n remixicon=\"RiSendPlaneLine\"\n />\n ),\n isActive: false,\n },\n {\n title: \"Junk\",\n url: \"#\",\n icon: (\n <IconPlaceholder\n lucide=\"ArchiveXIcon\"\n tabler=\"IconArchiveOff\"\n hugeicons=\"ArchiveIcon\"\n phosphor=\"ArchiveIcon\"\n remixicon=\"RiArchiveLine\"\n />\n ),\n isActive: false,\n },\n {\n title: \"Trash\",\n url: \"#\",\n icon: (\n <IconPlaceholder\n lucide=\"Trash2Icon\"\n tabler=\"IconTrash\"\n hugeicons=\"Delete02Icon\"\n phosphor=\"TrashIcon\"\n remixicon=\"RiDeleteBinLine\"\n />\n ),\n isActive: false,\n },\n ],\n mails: [\n {\n name: \"William Smith\",\n email: \"williamsmith@example.com\",\n subject: \"Meeting Tomorrow\",\n date: \"09:34 AM\",\n teaser:\n \"Hi team, just a reminder about our meeting tomorrow at 10 AM.\\nPlease come prepared with your project updates.\",\n },\n {\n name: \"Alice Smith\",\n email: \"alicesmith@example.com\",\n subject: \"Re: Project Update\",\n date: \"Yesterday\",\n teaser:\n \"Thanks for the update. The progress looks great so far.\\nLet's schedule a call to discuss the next steps.\",\n },\n {\n name: \"Bob Johnson\",\n email: \"bobjohnson@example.com\",\n subject: \"Weekend Plans\",\n date: \"2 days ago\",\n teaser:\n \"Hey everyone! I'm thinking of organizing a team outing this weekend.\\nWould you be interested in a hiking trip or a beach day?\",\n },\n {\n name: \"Emily Davis\",\n email: \"emilydavis@example.com\",\n subject: \"Re: Question about Budget\",\n date: \"2 days ago\",\n teaser:\n \"I've reviewed the budget numbers you sent over.\\nCan we set up a quick call to discuss some potential adjustments?\",\n },\n {\n name: \"Michael Wilson\",\n email: \"michaelwilson@example.com\",\n subject: \"Important Announcement\",\n date: \"1 week ago\",\n teaser:\n \"Please join us for an all-hands meeting this Friday at 3 PM.\\nWe have some exciting news to share about the company's future.\",\n },\n {\n name: \"Sarah Brown\",\n email: \"sarahbrown@example.com\",\n subject: \"Re: Feedback on Proposal\",\n date: \"1 week ago\",\n teaser:\n \"Thank you for sending over the proposal. I've reviewed it and have some thoughts.\\nCould we schedule a meeting to discuss my feedback in detail?\",\n },\n {\n name: \"David Lee\",\n email: \"davidlee@example.com\",\n subject: \"New Project Idea\",\n date: \"1 week ago\",\n teaser:\n \"I've been brainstorming and came up with an interesting project concept.\\nDo you have time this week to discuss its potential impact and feasibility?\",\n },\n {\n name: \"Olivia Wilson\",\n email: \"oliviawilson@example.com\",\n subject: \"Vacation Plans\",\n date: \"1 week ago\",\n teaser:\n \"Just a heads up that I'll be taking a two-week vacation next month.\\nI'll make sure all my projects are up to date before I leave.\",\n },\n {\n name: \"James Martin\",\n email: \"jamesmartin@example.com\",\n subject: \"Re: Conference Registration\",\n date: \"1 week ago\",\n teaser:\n \"I've completed the registration for the upcoming tech conference.\\nLet me know if you need any additional information from my end.\",\n },\n {\n name: \"Sophia White\",\n email: \"sophiawhite@example.com\",\n subject: \"Team Dinner\",\n date: \"1 week ago\",\n teaser:\n \"To celebrate our recent project success, I'd like to organize a team dinner.\\nAre you available next Friday evening? Please let me know your preferences.\",\n },\n ],\n}\n\nexport function AppSidebar({ ...props }: React.ComponentProps<typeof Sidebar>) {\n // Note: I'm using state to show active item.\n // IRL you should use the url/router.\n const [activeItem, setActiveItem] = React.useState(data.navMain[0])\n const [mails, setMails] = React.useState(data.mails)\n const { setOpen } = useSidebar()\n\n return (\n <Sidebar\n collapsible=\"icon\"\n className=\"overflow-hidden *:data-[sidebar=sidebar]:flex-row\"\n {...props}\n >\n {/* This is the first sidebar */}\n {/* We disable collapsible and adjust width to icon. */}\n {/* This will make the sidebar appear as icons. */}\n <Sidebar\n collapsible=\"none\"\n className=\"w-[calc(var(--sidebar-width-icon)+1px)]! border-r\"\n >\n <SidebarHeader>\n <SidebarMenu>\n <SidebarMenuItem>\n <SidebarMenuButton size=\"lg\" asChild className=\"md:h-8 md:p-0\">\n <a href=\"#\">\n <div className=\"bg-sidebar-primary text-sidebar-primary-foreground flex aspect-square size-8 items-center justify-center rounded-lg\">\n <IconPlaceholder\n lucide=\"TerminalIcon\"\n tabler=\"IconCommand\"\n hugeicons=\"CommandIcon\"\n phosphor=\"CommandIcon\"\n remixicon=\"RiCommandLine\"\n className=\"size-4\"\n />\n </div>\n <div className=\"grid flex-1 text-left text-sm leading-tight\">\n <span className=\"truncate font-medium\">Acme Inc</span>\n <span className=\"truncate text-xs\">Enterprise</span>\n </div>\n </a>\n </SidebarMenuButton>\n </SidebarMenuItem>\n </SidebarMenu>\n </SidebarHeader>\n <SidebarContent>\n <SidebarGroup>\n <SidebarGroupContent className=\"px-1.5 md:px-0\">\n <SidebarMenu>\n {data.navMain.map((item) => (\n <SidebarMenuItem key={item.title}>\n <SidebarMenuButton\n tooltip={{\n children: item.title,\n hidden: false,\n }}\n onClick={() => {\n setActiveItem(item)\n const mail = data.mails.sort(() => Math.random() - 0.5)\n setMails(\n mail.slice(\n 0,\n Math.max(5, Math.floor(Math.random() * 10) + 1)\n )\n )\n setOpen(true)\n }}\n isActive={activeItem?.title === item.title}\n className=\"px-2.5 md:px-2\"\n >\n {item.icon}\n <span>{item.title}</span>\n </SidebarMenuButton>\n </SidebarMenuItem>\n ))}\n </SidebarMenu>\n </SidebarGroupContent>\n </SidebarGroup>\n </SidebarContent>\n <SidebarFooter>\n <NavUser user={data.user} />\n </SidebarFooter>\n </Sidebar>\n\n {/* This is the second sidebar */}\n {/* We disable collapsible and let it fill remaining space */}\n <Sidebar collapsible=\"none\" className=\"hidden flex-1 md:flex\">\n <SidebarHeader className=\"gap-3.5 border-b p-4\">\n <div className=\"flex w-full items-center justify-between\">\n <div className=\"text-foreground text-base font-medium\">\n {activeItem?.title}\n </div>\n <Label className=\"flex items-center gap-2 text-sm\">\n <span>Unreads</span>\n <Switch className=\"shadow-none\" />\n </Label>\n </div>\n <SidebarInput placeholder=\"Type to search...\" />\n </SidebarHeader>\n <SidebarContent>\n <SidebarGroup className=\"px-0\">\n <SidebarGroupContent>\n {mails.map((mail) => (\n <a\n href=\"#\"\n key={mail.email}\n className=\"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground flex flex-col items-start gap-2 border-b p-4 text-sm leading-tight whitespace-nowrap last:border-b-0\"\n >\n <div className=\"flex w-full items-center gap-2\">\n <span>{mail.name}</span>{\" \"}\n <span className=\"ml-auto text-xs\">{mail.date}</span>\n </div>\n <span className=\"font-medium\">{mail.subject}</span>\n <span className=\"line-clamp-2 w-[260px] text-xs whitespace-break-spaces\">\n {mail.teaser}\n </span>\n </a>\n ))}\n </SidebarGroupContent>\n </SidebarGroup>\n </SidebarContent>\n </Sidebar>\n </Sidebar>\n )\n}\n",
"type": "registry:component"
},
{
"path": "registry/radix-vega/blocks/sidebar-09/components/nav-user.tsx",
"content": "\"use client\"\n\nimport {\n Avatar,\n AvatarFallback,\n AvatarImage,\n} from \"@/registry/radix-vega/ui/avatar\"\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuTrigger,\n} from \"@/registry/radix-vega/ui/dropdown-menu\"\nimport {\n SidebarMenu,\n SidebarMenuButton,\n SidebarMenuItem,\n useSidebar,\n} from \"@/registry/radix-vega/ui/sidebar\"\nimport { IconPlaceholder } from \"@/app/(create)/components/icon-placeholder\"\n\nexport function NavUser({\n user,\n}: {\n user: {\n name: string\n email: string\n avatar: string\n }\n}) {\n const { isMobile } = useSidebar()\n\n return (\n <SidebarMenu>\n <SidebarMenuItem>\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <SidebarMenuButton\n size=\"lg\"\n className=\"data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground md:h-8 md:p-0\"\n >\n <Avatar className=\"h-8 w-8 rounded-lg\">\n <AvatarImage src={user.avatar} alt={user.name} />\n <AvatarFallback className=\"rounded-lg\">CN</AvatarFallback>\n </Avatar>\n <div className=\"grid flex-1 text-left text-sm leading-tight\">\n <span className=\"truncate font-medium\">{user.name}</span>\n <span className=\"truncate text-xs\">{user.email}</span>\n </div>\n <IconPlaceholder\n lucide=\"ChevronsUpDownIcon\"\n tabler=\"IconSelector\"\n hugeicons=\"UnfoldMoreIcon\"\n phosphor=\"CaretUpDownIcon\"\n remixicon=\"RiArrowUpDownLine\"\n className=\"ml-auto size-4\"\n />\n </SidebarMenuButton>\n </DropdownMenuTrigger>\n <DropdownMenuContent\n className=\"w-(--radix-dropdown-menu-trigger-width) min-w-56 rounded-lg\"\n side={isMobile ? \"bottom\" : \"right\"}\n align=\"end\"\n sideOffset={4}\n >\n <DropdownMenuLabel className=\"p-0 font-normal\">\n <div className=\"flex items-center gap-2 px-1 py-1.5 text-left text-sm\">\n <Avatar className=\"h-8 w-8 rounded-lg\">\n <AvatarImage src={user.avatar} alt={user.name} />\n <AvatarFallback className=\"rounded-lg\">CN</AvatarFallback>\n </Avatar>\n <div className=\"grid flex-1 text-left text-sm leading-tight\">\n <span className=\"truncate font-medium\">{user.name}</span>\n <span className=\"truncate text-xs\">{user.email}</span>\n </div>\n </div>\n </DropdownMenuLabel>\n <DropdownMenuSeparator />\n <DropdownMenuGroup>\n <DropdownMenuItem>\n <IconPlaceholder\n lucide=\"SparklesIcon\"\n tabler=\"IconSparkles\"\n hugeicons=\"SparklesIcon\"\n phosphor=\"SparkleIcon\"\n remixicon=\"RiSparklingLine\"\n />\n Upgrade to Pro\n </DropdownMenuItem>\n </DropdownMenuGroup>\n <DropdownMenuSeparator />\n <DropdownMenuGroup>\n <DropdownMenuItem>\n <IconPlaceholder\n lucide=\"BadgeCheckIcon\"\n tabler=\"IconRosetteDiscountCheck\"\n hugeicons=\"CheckmarkBadgeIcon\"\n phosphor=\"CheckCircleIcon\"\n remixicon=\"RiCheckboxCircleLine\"\n />\n Account\n </DropdownMenuItem>\n <DropdownMenuItem>\n <IconPlaceholder\n lucide=\"CreditCardIcon\"\n tabler=\"IconCreditCard\"\n hugeicons=\"CreditCardIcon\"\n phosphor=\"CreditCardIcon\"\n remixicon=\"RiBankCardLine\"\n />\n Billing\n </DropdownMenuItem>\n <DropdownMenuItem>\n <IconPlaceholder\n lucide=\"BellIcon\"\n tabler=\"IconBell\"\n hugeicons=\"NotificationIcon\"\n phosphor=\"BellIcon\"\n remixicon=\"RiNotificationLine\"\n />\n Notifications\n </DropdownMenuItem>\n </DropdownMenuGroup>\n <DropdownMenuSeparator />\n <DropdownMenuItem>\n <IconPlaceholder\n lucide=\"LogOutIcon\"\n tabler=\"IconLogout\"\n hugeicons=\"LogoutIcon\"\n phosphor=\"SignOutIcon\"\n remixicon=\"RiLogoutBoxLine\"\n />\n Log out\n </DropdownMenuItem>\n </DropdownMenuContent>\n </DropdownMenu>\n </SidebarMenuItem>\n </SidebarMenu>\n )\n}\n",
"type": "registry:component"
}
],
"categories": [
"sidebar",
"dashboard"
],
"type": "registry:block"
}
Source
Frequently Asked Questions
What does sidebar-09.json do?
sidebar-09.json is a source file in the ui codebase, written in json.
Where is sidebar-09.json in the architecture?
sidebar-09.json is located at apps/v4/public/r/styles/radix-vega/sidebar-09.json (directory: apps/v4/public/r/styles/radix-vega).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free