App Shell

Tailwind app shell layout with a fixed width sidebar slot, a topbar slot and a scrolling main area. The sidebar hides below the md breakpoint for mobile.

src/registry/ui/app-shell.tsx/r/app-shell.json

Installation#

bash
npx shadcn@latest add @minidev/app-shell

MiniDev UI is in the shadcn registry directory, so the short form works with no setup. Older CLI versions can use the full URL: npx shadcn@latest add https://ui.minidev.pro/r/app-shell.json

Usage#

tsx
import { AppShell } from "@/components/ui/app-shell"

export function Example() {
  return (
    <AppShell className="max-w-5xl" sidebar={<Sidebar><div className="p-3 text-xs font-medium text-fg-muted">MiniDev</div><SidebarNavItem active>Overview</SidebarNavItem><SidebarNavItem>Projects</SidebarNavItem></Sidebar>} topbar={<Topbar left={<span className="text-sm text-fg">Dashboard</span>} />}>
      <DashboardHome />
    </AppShell>
  )
}

API reference#

AppShell props
PropTypeDefault
sidebarReact.ReactNode-
topbarReact.ReactNode-
childrenReact.ReactNode-
classNamestring-

Examples#

All layout components

Learn more