App shell
Sidebar, nav items and top bar landmarks for application layouts.
The app shell is the frame around a signed-in product: a 240 px Sidebar of NavItem links, and a 56 px TopBar above the page content. They are server components made of landmarks and links; interactive parts, such as an account menu or a mobile drawer, are client components you pass in.
Launches 14 March 2027, with 5 people
Installation
Pro components install from the Aloxe registry with the shadcn CLI. Once per project, add the registry to components.json and put a registry token in the ALOXE_TOKEN environment variable. Registry has the details.
{
"registries": {
"@aloxe": {
"url": "https://<aloxe-site>/r/{name}.json",
"headers": { "Authorization": "Bearer ${ALOXE_TOKEN}" }
}
}
}Then add the component:
npx shadcn@latest add @aloxe/app-shellThe CLI copies the source into components/ui/aloxe/, so it never overwrites your own ui components. It also installs @aloxe/react, @aloxe/tokens and @base-ui/react.
Import the tokens once in your global stylesheet, after Tailwind, and add an @source for the copied files and one for @aloxe/react, so Tailwind generates their classes. @source paths are relative to the stylesheet; these assume src/app/globals.css and src/components/ui/aloxe/.
@import "tailwindcss";
@import "@aloxe/tokens/aloxe.css";
@import "@aloxe/tokens/tailwind.css";
@source "../components/ui/aloxe";
@source "../../node_modules/@aloxe/react/dist";Installation covers the theme and brand attributes.
Usage
// app/(app)/layout.tsx
import Link from "next/link";
import { NavItem, Sidebar, TopBar } from "@/components/ui/aloxe/app-shell";
export default function AppLayout({ children }: LayoutProps<"/">) {
return (
<div className="flex h-dvh">
<Sidebar header={<span>Northwind Studio</span>} className="hidden md:flex">
<NavItem href="/projects" linkComponent={Link} active>Projects</NavItem>
<NavItem href="/invoices" linkComponent={Link} count={3}>Invoices</NavItem>
</Sidebar>
<div className="flex min-w-0 flex-1 flex-col">
<TopBar actions={<AccountMenu />}>
<MobileNav />
</TopBar>
<main className="min-h-0 flex-1 overflow-y-auto p-6">{children}</main>
</div>
</div>
);
}The sidebar sets no height of its own: in a flex row it stretches to the row. Mark the current page with active. Under your breakpoint, hide the sidebar and put a menu button in the top bar that opens the same links, as the preview does with a dropdown menu when it is narrow.
Examples
Nav items
A NavItem has a 16 px icon, a label and an optional count. The active item uses the accent subtle background and accent text.
Top bar
The top bar holds a breadcrumb or the page title on the left and up to three actions on the right. Its height matches the sidebar header, so their hairlines line up.
Accessibility
| Key | Action |
|---|---|
| Tab and Shift+Tab | Move through the nav items, then the top bar, then the page. |
| Enter | Follows the focused nav item. |
- The sidebar's links sit in a
navlandmark named "Main" (change it withlabel). The top bar is aheader, the page banner when it isn't insidemain. Put the page content inmain. - The active item has
aria-current="page"and differs by background and text colour. - A
countis part of the link's accessible name ("Invoices 3"). Add hidden text if the number needs a word, such as "3 unpaid". - Icons are decorative and hidden from screen readers.
- Add a skip link to
mainbefore the sidebar when the nav is long.
API reference
Every part accepts className and renders a data-aloxe attribute you can target in CSS, such as [data-aloxe="nav-item"].
Sidebar
Extends <div> + <nav>.
| Prop | Type | Default | Description |
|---|---|---|---|
| header | ReactNode | The 56 px top area: the product name or a workspace switcher. | |
| footer | ReactNode | The bottom area, under a hairline: the signed-in account or help links. | |
| label | string | "Main" | Accessible name of the nav landmark that holds the NavItems. |
| children | ReactNode | NavItems, with group labels between them. The list scrolls on its own when it is long. | |
| className | string | Classes for the 240 px column, such as h-dvh or hidden md:flex. |
NavItem
Extends <a>.
| Prop | Type | Default | Description |
|---|---|---|---|
| href (required) | string | Where the item goes. | |
| active | boolean | false | The item for the current page. Sets aria-current="page". |
| icon | ReactNode | A 16 px line icon before the label. Decorative. | |
| count | ReactNode | A number after the label, such as unread items. Part of the link's accessible name. | |
| linkComponent | ElementType | "a" | The element for the link, such as Next.js Link. |
| className | string | Merged with the default classes. |
TopBar
Extends <header>.
| Prop | Type | Default | Description |
|---|---|---|---|
| children | ReactNode | Left side: a Breadcrumb or the page title, and a menu button for small screens. | |
| actions | ReactNode | Right side, with an 8 px gap: search, notifications, the account menu. | |
| className | string | Merged with the default classes. |
Figma
Matches the Sidebar, Nav item and Top bar components in the Pro Figma file. Nav item State=Active maps to active; Icon, Show count and Count map to icon and count.
See Figma for where to get the file and how its names map to code.
Pro
App shell is part of Aloxe Pro. The previews on this page are open to everyone; the Code tab shows the example source once you sign in with a Pro license. See Access and licenses and Pricing.