{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "app-shell-03",
  "description": "An app shell with the page set in a card beside the sidebar, and plan usage with an upgrade link above the user menu.",
  "registryDependencies": [
    "separator",
    "sidebar",
    "https://www.dashboardblocks.com/r/radix/app-shell.json",
    "https://www.dashboardblocks.com/r/radix/shortcut-button.json"
  ],
  "files": [
    {
      "path": "registry/components/dashboardblocks/app-shell/app-shell-03.tsx",
      "content": "'use client'\n\nimport {\n  AppBreadcrumbs,\n  AppHeader,\n  AppNav,\n  type AppUser,\n  type Crumb,\n  type NavSection,\n  NotificationsButton,\n  PlanUsage,\n  type PlanUsageProps,\n  SearchButton,\n  SidebarUserMenu,\n  type ThemeChoice,\n  type UserMenuLink,\n  useShortcut,\n  type Workspace,\n  WorkspaceSwitcher,\n} from '@/registry/components/dashboardblocks/app-shell'\nimport { ShortcutButton } from '@/registry/components/dashboardblocks/shortcut-button'\nimport { IconPlaceholder } from '@/registry/icons/icon-placeholder'\nimport { type ReactNode, useState } from 'react'\n\nimport { Separator } from '@/components/ui/separator'\nimport {\n  Sidebar,\n  SidebarContent,\n  SidebarFooter,\n  SidebarHeader,\n  SidebarInset,\n  SidebarProvider,\n  SidebarTrigger,\n  useSidebar,\n} from '@/components/ui/sidebar'\n\nimport { cn } from '@/lib/utils'\n\ninterface AppShell3Props {\n  /** Buttons at the end of the header, after search, such as a clock or a notification bell. */\n  actions?: ReactNode\n  breadcrumbs: Crumb[]\n  /** `sm` leaves the breadcrumb out on a phone, for an app whose pages name themselves in a heading under the bar and that needs the room for its buttons. */\n  breadcrumbsFrom?: 'sm'\n  children?: ReactNode\n  /** The first page. With one workspace and no `onCreateWorkspace`, the workspace header links here. */\n  homeHref?: string\n  /** Leave out to hide the notifications button, such as when `actions` holds a bell. */\n  notificationCount?: number\n  /** Adds \"New workspace\" to the workspace switcher. */\n  onCreateWorkspace?: () => void\n  onNotificationsClick?: () => void\n  onSearch?: () => void\n  onSignOut?: () => void\n  pathname: string\n  /** `sidebar` puts search under the workspace switcher, for a header that holds other buttons; below `md`, where the sidebar is a sheet, and while it's collapsed, it stays in the header as an icon. @default 'header' */\n  searchIn?: 'header' | 'sidebar'\n  /** Pinned to the bottom of the sidebar, above the user menu, such as Settings. */\n  secondarySections?: NavSection[]\n  sections: NavSection[]\n  /** Adds a Light, Dark and System choice to the user menu, such as `useTheme()` from next-themes. */\n  theme?: ThemeChoice\n  /** Leave out to hide plan usage. */\n  usage?: PlanUsageProps\n  user: AppUser\n  userLinks: UserMenuLink[]\n  workspaces: Workspace[]\n}\n\nconst exampleProps: AppShell3Props = {\n  breadcrumbs: [{ href: '#', label: 'Monitoring' }, { label: 'Events' }],\n  notificationCount: 0,\n  pathname: '/events',\n  sections: [\n    {\n      items: [\n        {\n          href: '/',\n          icon: (\n            <IconPlaceholder\n              lucide='LayoutDashboardIcon'\n              tabler='IconDashboard'\n              hugeicons='DashboardSquare01Icon'\n              phosphor='SquaresFourIcon'\n              remixicon='RiDashboardLine'\n            />\n          ),\n          title: 'Overview',\n        },\n        {\n          badge: '1.2k',\n          href: '/events',\n          icon: (\n            <IconPlaceholder\n              lucide='ActivityIcon'\n              tabler='IconActivity'\n              hugeicons='ActivityIcon'\n              phosphor='ActivityIcon'\n              remixicon='RiPulseLine'\n            />\n          ),\n          title: 'Events',\n        },\n        {\n          href: '/alerts',\n          icon: (\n            <IconPlaceholder\n              lucide='BellRingIcon'\n              tabler='IconBellRinging'\n              hugeicons='NotificationSquareIcon'\n              phosphor='BellRingingIcon'\n              remixicon='RiNotification3Line'\n            />\n          ),\n          title: 'Alerts',\n        },\n      ],\n      label: 'Monitoring',\n    },\n    {\n      items: [\n        {\n          href: '/sources',\n          icon: (\n            <IconPlaceholder\n              lucide='DatabaseIcon'\n              tabler='IconDatabase'\n              hugeicons='Database01Icon'\n              phosphor='DatabaseIcon'\n              remixicon='RiDatabase2Line'\n            />\n          ),\n          title: 'Sources',\n        },\n        {\n          href: '/destinations',\n          icon: (\n            <IconPlaceholder\n              lucide='SendIcon'\n              tabler='IconSend'\n              hugeicons='SentIcon'\n              phosphor='PaperPlaneTiltIcon'\n              remixicon='RiSendPlaneLine'\n            />\n          ),\n          title: 'Destinations',\n        },\n        {\n          href: '/settings',\n          icon: (\n            <IconPlaceholder\n              lucide='Settings2Icon'\n              tabler='IconSettings'\n              hugeicons='Settings05Icon'\n              phosphor='GearIcon'\n              remixicon='RiSettingsLine'\n            />\n          ),\n          title: 'Settings',\n        },\n      ],\n      label: 'Configure',\n    },\n  ],\n  usage: {\n    action: { href: '/billing', label: 'Upgrade' },\n    limit: 10_000,\n    title: 'Free plan',\n    unit: 'events',\n    used: 8_420,\n  },\n  user: {\n    avatar: '/images/avatar-02.webp',\n    email: 'priya@relay.dev',\n    name: 'Priya Nair',\n  },\n  userLinks: [\n    {\n      href: '/account',\n      icon: (\n        <IconPlaceholder\n          lucide='CircleUserRoundIcon'\n          tabler='IconUserCircle'\n          hugeicons='UserCircle02Icon'\n          phosphor='UserCircleIcon'\n          remixicon='RiUserLine'\n        />\n      ),\n      label: 'Account',\n    },\n    {\n      href: '/billing',\n      icon: (\n        <IconPlaceholder\n          lucide='CreditCardIcon'\n          tabler='IconCreditCard'\n          hugeicons='CreditCardIcon'\n          phosphor='CreditCardIcon'\n          remixicon='RiBankCardLine'\n        />\n      ),\n      label: 'Billing',\n    },\n  ],\n  workspaces: [\n    {\n      id: 'relay',\n      logo: (\n        <IconPlaceholder\n          lucide='ZapIcon'\n          tabler='IconBolt'\n          hugeicons='FlashIcon'\n          phosphor='LightningIcon'\n          remixicon='RiFlashlightLine'\n        />\n      ),\n      name: 'Relay',\n      plan: 'Production',\n    },\n    {\n      id: 'relay-staging',\n      logo: (\n        <IconPlaceholder\n          lucide='TerminalSquareIcon'\n          tabler='IconTerminal2'\n          hugeicons='ComputerTerminalIcon'\n          phosphor='TerminalIcon'\n          remixicon='RiTerminalBoxLine'\n        />\n      ),\n      name: 'Relay',\n      plan: 'Staging',\n    },\n  ],\n}\n\n/** Search in the header while the sidebar that holds it is a closed sheet or collapsed, with ⌘K for it. */\nfunction HeaderSearch({ onOpen }: { onOpen: () => void }) {\n  const { state } = useSidebar()\n  useShortcut('k', onOpen)\n\n  return (\n    <ShortcutButton\n      aria-keyshortcuts='Meta+K Control+K'\n      aria-label='Search'\n      className={cn(state === 'expanded' && 'md:hidden')}\n      label='Search'\n      onClick={onOpen}\n      shortcut='⌘K'\n      variant='outline'\n    >\n      <IconPlaceholder\n        lucide='SearchIcon'\n        tabler='IconSearch'\n        hugeicons='SearchIcon'\n        phosphor='MagnifyingGlassIcon'\n        remixicon='RiSearchLine'\n      />\n    </ShortcutButton>\n  )\n}\n\nconst AppShell3 = (props: AppShell3Props) => {\n  const {\n    actions,\n    breadcrumbs,\n    breadcrumbsFrom,\n    children,\n    homeHref,\n    notificationCount,\n    onCreateWorkspace,\n    onNotificationsClick = () => {},\n    onSearch = () => {},\n    onSignOut = () => {},\n    pathname,\n    searchIn = 'header',\n    secondarySections,\n    sections,\n    theme,\n    usage,\n    user,\n    userLinks,\n    workspaces,\n  } = props\n  const [workspace, setWorkspace] = useState(workspaces[0]?.id ?? '')\n\n  return (\n    <SidebarProvider>\n      <Sidebar variant='inset'>\n        <SidebarHeader>\n          <WorkspaceSwitcher\n            href={homeHref}\n            onCreate={onCreateWorkspace}\n            onValueChange={setWorkspace}\n            value={workspace}\n            workspaces={workspaces}\n          />\n          {searchIn === 'sidebar' && (\n            <SearchButton collapseBelow='never' onOpen={onSearch} shortcut={false} />\n          )}\n        </SidebarHeader>\n        <SidebarContent>\n          <AppNav pathname={pathname} sections={sections} />\n          {secondarySections && (\n            <AppNav\n              className='mt-auto'\n              pathname={pathname}\n              sections={secondarySections}\n            />\n          )}\n        </SidebarContent>\n        <SidebarFooter>\n          {usage && <PlanUsage {...usage} />}\n          <SidebarUserMenu\n            className='bg-background hover:bg-sidebar-accent aria-expanded:bg-sidebar-accent dark:bg-input/30 dark:hover:bg-sidebar-accent dark:aria-expanded:bg-sidebar-accent'\n            links={userLinks}\n            onSignOut={onSignOut}\n            theme={theme}\n            user={user}\n          />\n        </SidebarFooter>\n      </Sidebar>\n      <SidebarInset className='min-w-0'>\n        <AppHeader className='md:rounded-t-xl'>\n          <SidebarTrigger className='-ml-1' />\n          <Separator\n            orientation='vertical'\n            className={cn(\n              'mr-2 data-vertical:h-4 data-vertical:self-auto',\n              breadcrumbsFrom === 'sm' && 'max-sm:hidden',\n            )}\n          />\n          <AppBreadcrumbs\n            className={cn(breadcrumbsFrom === 'sm' && 'max-sm:hidden')}\n            items={breadcrumbs}\n          />\n          <div className='ml-auto flex items-center gap-2'>\n            {searchIn === 'header' ? (\n              <SearchButton onOpen={onSearch} />\n            ) : (\n              <HeaderSearch onOpen={onSearch} />\n            )}\n            {notificationCount !== undefined && (\n              <NotificationsButton\n                count={notificationCount}\n                onClick={onNotificationsClick}\n              />\n            )}\n            {actions}\n          </div>\n        </AppHeader>\n        <div className='flex flex-1 flex-col gap-4 p-4 md:p-6'>\n          {children ?? <PagePlaceholder />}\n        </div>\n      </SidebarInset>\n    </SidebarProvider>\n  )\n}\n\nconst PLACEHOLDER_EVENTS = ['w-1/2', 'w-2/5', 'w-3/5', 'w-1/3', 'w-1/2', 'w-2/5', 'w-1/4']\n\nfunction PagePlaceholder() {\n  return (\n    <div className='flex flex-1 flex-col gap-8'>\n      <div className='flex flex-col gap-2'>\n        <div className='bg-muted h-7 w-40 rounded-md' />\n        <div className='bg-muted/60 h-4 w-80 max-w-full rounded-md' />\n      </div>\n      <div className='flex flex-col border-t'>\n        {PLACEHOLDER_EVENTS.map((width, index) => (\n          <div key={index} className='flex items-start gap-3 border-b py-3.5'>\n            <div className='bg-muted mt-1 size-2 shrink-0 rounded-full' />\n            <div className='flex min-w-0 flex-1 flex-col gap-2'>\n              <div className={cn('bg-muted h-3.5 rounded-sm', width)} />\n              <div className='bg-muted/60 h-3 w-24 rounded-sm' />\n            </div>\n            <div className='bg-muted/60 h-3 w-12 shrink-0 rounded-sm' />\n          </div>\n        ))}\n      </div>\n    </div>\n  )\n}\n\nexport { AppShell3, exampleProps as appShell3ExampleProps, type AppShell3Props }\n",
      "type": "registry:component",
      "target": "@components/dashboardblocks/app-shell/app-shell-03.tsx"
    }
  ],
  "meta": {
    "shows": "An app shell with the page set in a card beside the sidebar, and plan usage with an upgrade link above the user menu.",
    "size": "page",
    "usedWith": [
      "app-shell-01"
    ],
    "component": "AppShell3",
    "props": "{ actions?: ReactNode; breadcrumbs: { href?: string; label: string }[]; breadcrumbsFrom?: \"sm\"; children?: ReactNode; homeHref?: string; notificationCount?: number; onCreateWorkspace?: () => void; onNotificationsClick?: () => void; onSearch?: () => void; onSignOut?: () => void; pathname: string; searchIn?: \"header\" | \"sidebar\"; secondarySections?: { items: { badge?: ReactNode; href?: string; icon: ReactNode; items?: { badge?: ReactNode; href: string; icon?: ReactNode; title: string }[]; onSelect?: () => void; title: string }[]; label?: string }[]; sections: { items: { badge?: ReactNode; href?: string; icon: ReactNode; items?: { badge?: ReactNode; href: string; icon?: ReactNode; title: string }[]; onSelect?: () => void; title: string }[]; label?: string }[]; theme?: { onValueChange: (theme: \"light\" | \"dark\" | \"system\") => void; value: \"light\" | \"dark\" | \"system\" }; usage?: { action?: { href: string; label: string }; limit: number; note?: ReactNode; unit?: string; title: string; used: number }; user: { avatar?: string; email: string; name: string }; userLinks: { href: string; icon: ReactNode; label: string }[]; workspaces: { id: string; logo: ReactNode; name: string; plan?: string }[] }"
  },
  "type": "registry:component"
}
