UI.MD

App Shell

The frame of an app page: a sidebar of destinations, a top bar, and the page under it. On a phone the sidebar folds into a menu button that opens the same nav in a drawer.

Installation

$
npx shadcn@latest add https://ui.mattdowney.com/r/app-shell.json

Usage

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

Examples

Default

A vertical Nav in nav, the top bar's contents in header, the page as children. Below md the sidebar hides and a menu button opens the same Nav in a drawer, which closes when a link is followed.

DashboardMD

Dashboard

API Reference

PropTypeDefaultDescription
navAppShellReactNode-The destinations, a <Nav orientation="vertical">. Shown in the sidebar from md up and in the drawer below it.
brandAppShellReactNode-The app's logo or name, at the top of the sidebar and the drawer.
headerAppShellReactNode-The top bar's contents, laid out as a row with the far end free for actions.
childrenAppShellReactNode-The page, usually a <main>, under the top bar.
navAppShellReactNodeThe destinations, a <Nav orientation="vertical">. Shown in the sidebar from md up and in the drawer below it.
brandAppShellReactNodeThe app's logo or name, at the top of the sidebar and the drawer.
headerAppShellReactNodeThe top bar's contents, laid out as a row with the far end free for actions.
childrenAppShellReactNodeThe page, usually a <main>, under the top bar.