The frame of a signed-in app: a sidebar with a workspace switcher, nav, pinned items and a usage slot that folds to an icon rail, and a topbar with a breadcrumb, search, notifications and the account menu. On phones the sidebar is a sheet.
On this page
- Signed-in app frame
- Agent dashboard layout
- Settings area chrome
- Console with a sticky topbar
- Embedded preview frame
Examples
Icon rail
Installation
npx knowns-ui@latest add app-shellPaste this into your coding agent (Claude Code, Cursor, Codex). It checks your project, sets up the registry, runs the install and verifies it.
Install App Shell from Knowns UI into this project. Work step by step, show me each change, and ask before you edit files outside this project.
Context: Knowns UI (https://ui.knowns.dev) is a shadcn registry. Items land in the project as source files. Docs: https://ui.knowns.dev/docs/app-shell
1. Check the project first. Stop and tell me if any of these is missing:
- React 19 and Tailwind CSS v4.
- A components.json at the project root. If there is none, ask me before running `npx knowns-ui@latest init --no-key` (it runs shadcn init when needed, then adds the registries).
2. Run:
```bash
npx knowns-ui@latest add app-shell
```
It writes these files:
- lib/knowns/run.ts
- lib/knowns/json.tsx
- lib/knowns/status.ts
- lib/knowns/tone.ts
- lib/knowns/types.ts
- lib/knowns/use-abortable.ts
- lib/knowns/utils.ts
- lib/knowns/motion.tsx
- lib/knowns/motion-utils.ts
- components/ui/knowns/use-floating.ts
- components/ui/knowns/menu.tsx
- components/ui/knowns/breadcrumb.tsx
- lib/knowns/home.ts
- lib/knowns/home-utils.ts
- components/ui/knowns/kbd.tsx
- components/ui/knowns/tooltip.tsx
- components/ui/knowns/tooltip-utils.ts
- components/ui/knowns/avatar.tsx
- components/ui/knowns/popover.tsx
- components/ui/knowns/spinner.tsx
- components/ui/knowns/button.tsx
- components/ui/knowns/sheet.tsx
- components/ui/knowns/blocks/sidebar/sidebar.tsx
- components/ui/knowns/blocks/sidebar/sidebar-utils.ts
- components/ui/knowns/blocks/app-shell/app-shell.tsx
and installs these npm packages: clsx@^2.1.1, tailwind-merge@^3.7.0, class-variance-authority@^0.7.1.
3. While it runs:
- It also adds a few @keyframes (all named kn-*) to the global CSS file (globals.css or the file components.json points at). Let it: they only add animations.
- If it asks to overwrite files under lib/knowns/: these are shared by every Knowns UI item. List them, say whether I changed them (check git), and ask me before you answer.
- If it asks to overwrite any other file, show me the diff and ask me.
4. Verify:
- Every file in the list above exists.
- The project type-checks (for example `npx tsc --noEmit`) and the dev build has no new errors.
5. Use it: follow the examples and props on https://ui.knowns.dev/docs/app-shell, and ask me if anything about my data is unclear.
If the Knowns UI MCP server is connected (https://ui.knowns.dev/docs/ai-and-mcp), use get_component({ name: "app-shell" }) or search_docs for details.
Finish with a short summary: the files you added or changed, the packages you installed, and anything I still need to do.Props
- nav / active / onSelect / linkAs
SidebarNode[] / string / (node) => void / Component- The main tree (see Sidebar): icons, counts, badges, nested branches. The active row is marked and its branch opens.
- workspaces / workspace / onWorkspaceChange / onCreateWorkspace
SidebarWorkspace[] / string / …- The switcher at the top; leave out for one workspace.
- groups
{ id, label, items, collapsible? }[]- Default
[] - Pinned items, favourites: labelled, foldable groups under the nav.
- sidebarFooter
ReactNode- The bottom of the sidebar: a usage meter or an upgrade card. Hidden in the rail.
- sidebarWidth
number- Default
256 - Expanded sidebar width in px.
- sidebarClassName
string- Extra classes on the sidebar panel, e.g. [&_.h-8]:h-7 to make the nav rows 28px.
- breadcrumb
BreadcrumbItem[]- Where you are. Long trails fold their middle into a menu.
- onHome
() => void- Go to the app's home view: the first crumb (the workspace) becomes the home control, then the page scrolls to the top.
- search
{ onOpen, label? }- A search field with a ⌘K hint from 768px, an icon below. Open your Command Menu here.
- notifications / actions / user
ReactNode- Topbar slots, right to left: your UserMenu last.
- storageKey / defaultCollapsed / hotkey / mobileBelow
string / boolean / boolean / number- Default
- / false / true / 768 - State: the remembered rail, ⌘B or Ctrl+B, and the width below which the sidebar is a sheet.
- layout
"page"|"fill"- Default
"page" - page: the window scrolls, the sidebar and topbar stick. fill: the shell fills its parent and the main column scrolls.
- embedded
boolean- Default
false - Render the main column as a div and the sidebar without an aside landmark, for a shell shown inside another page (one main per page).
- labelPrefix
string- Prefixes the shell's navigation and breadcrumb labels so two shells on one page have unique names.
| Prop | Type | Default | Description |
|---|---|---|---|
| nav / active / onSelect / linkAs | SidebarNode[] / string / (node) => void / Component | - | The main tree (see Sidebar): icons, counts, badges, nested branches. The active row is marked and its branch opens. |
| workspaces / workspace / onWorkspaceChange / onCreateWorkspace | SidebarWorkspace[] / string / … | - | The switcher at the top; leave out for one workspace. |
| groups | { id, label, items, collapsible? }[] | [] | Pinned items, favourites: labelled, foldable groups under the nav. |
| sidebarFooter | ReactNode | - | The bottom of the sidebar: a usage meter or an upgrade card. Hidden in the rail. |
| sidebarWidth | number | 256 | Expanded sidebar width in px. |
| sidebarClassName | string | - | Extra classes on the sidebar panel, e.g. [&_.h-8]:h-7 to make the nav rows 28px. |
| breadcrumb | BreadcrumbItem[] | - | Where you are. Long trails fold their middle into a menu. |
| onHome | () => void | - | Go to the app's home view: the first crumb (the workspace) becomes the home control, then the page scrolls to the top. |
| search | { onOpen, label? } | - | A search field with a ⌘K hint from 768px, an icon below. Open your Command Menu here. |
| notifications / actions / user | ReactNode | - | Topbar slots, right to left: your UserMenu last. |
| storageKey / defaultCollapsed / hotkey / mobileBelow | string / boolean / boolean / number | - / false / true / 768 | State: the remembered rail, ⌘B or Ctrl+B, and the width below which the sidebar is a sheet. |
| layout | "page" | "fill" | "page" | page: the window scrolls, the sidebar and topbar stick. fill: the shell fills its parent and the main column scrolls. |
| embedded | boolean | false | Render the main column as a div and the sidebar without an aside landmark, for a shell shown inside another page (one main per page). |
| labelPrefix | string | - | Prefixes the shell's navigation and breadcrumb labels so two shells on one page have unique names. |
Built from the Sidebar block, so the keyboard is the same: ⌘B or Ctrl+B toggles the rail, the nav is one tab stop with arrow keys inside, and the rail shows each name as a tooltip. On phones the topbar's toggle opens the sidebar as a modal sheet that returns focus when it closes.
What it handles
- 01Wraps your page in a sidebar and a sticky 56px topbar, from props alone: `nav`, `groups`, `workspaces`, `breadcrumb`, `search`, `notifications`, `actions` and `user`.
- 02Marks the current row with `active` and passes every picked row to `onSelect`, with `linkAs` to swap the row link for your router's link.
- 03Adds labelled pinned groups under the main nav, each its own SidebarNav that can fold, with its open state saved under `storageKey`.
- 04Keeps the sidebar in a rail the user chose, with Cmd or Ctrl+B and a footer slot for a usage meter that hides itself in the rail.
- 05Scrolls the window with layout="page", or fills its parent and scrolls only the main column with layout="fill" for a preview frame.
- 06Drops its own main and complementary landmarks with `embedded`, and prefixes its names with `labelPrefix`, so several shells on one page stay unique.
States
- First render
- Nothing. The shell paints with its remembered rail state
- none
- Collapse the sidebar
- The sidebar width switches at once and its labels fade out
- 120ms, ease out
- Fold a pinned group
- The group's rows grow or shrink and fade
- 180ms, ease out
- Search button
- Opens your handler with no motion of its own
- none
- Reduced motion
- Labels no longer fade and groups fold at once
- 0ms
| State | What moves | Timing |
|---|---|---|
| First render | Nothing. The shell paints with its remembered rail state | none |
| Collapse the sidebar | The sidebar width switches at once and its labels fade out | 120ms, ease out |
| Fold a pinned group | The group's rows grow or shrink and fade | 180ms, ease out |
| Search button | Opens your handler with no motion of its own | none |
| Reduced motion | Labels no longer fade and groups fold at once | 0ms |
Works with
- SidebarInstalled with it. All the nav, rail, switcher and mobile sheet behaviour is its.
- BreadcrumbInstalled with it. The topbar shows it on one line and only the current page below 640px.
- User menuPairs with it: pass one in `user` for the account menu at the right of the topbar.
- Notification centerPairs with it: pass its bell in `notifications` to sit before the user.
When to use
When to use
- The frame of a signed-in app: sidebar with a workspace switcher and nav, topbar with breadcrumb, search, notifications and the account menu.
- Dashboards and admin tools where the navigation stays put and only the page changes.
When not to use
- Only the navigation column, inside your own layout: use Sidebar.
- Marketing pages and docs with a top bar: use Site Header.
Using with AI
Use Copy page for AI above to give your assistant this page, Copy prompt under the install command to have it installed and wired to your data, or connect the Knowns UI MCP server and just ask:
- Add the Knowns UI App Shell to my app and wire it to my own data.
- I need the frame of a signed-in app: sidebar with a workspace switcher and nav, topbar with breadcrumb, search, notifications and the account menu. Set that up with the Knowns UI App Shell.
- Which App Shell props do I need for a minimal setup? Show me a short example.
With the server connected, your assistant calls get_component({ name: "app-shell" }) and search_docs({ query: "app shell" }).