- Docs
- Components
- Console frame
App shell
The frame of a Qeet console: the scope bar, the navigation, the page, and panels on the end edge.
- Import
- @qeetrix/react/experimental
- Status
- ExperimentalSince 0.0.4
- Renders
<main>Server-rendered- Tested
- WCAG 2.2 AAaxe on every pull request
01
Import
// Experimental: from the package's experimental entry, until it's stable.
import { AppShell, useAppShell } from "@qeetrix/react/experimental";02
Props
And every native attribute of the element it renders.
| Prop | Type | Default | What it does |
|---|---|---|---|
topBar | ReactNode | — | The global bar: a TopBar. |
sidebar | ReactNode | — | The navigation: a Sidebar. |
drawers | { id, label, icon, content, badge?, width?, resizable? }[] | — | End-edge panels; their triggers sit in the TopBar. width, 320 by default; resizable, a splitter on its start edge. |
activeDrawer · defaultActiveDrawer · onActiveDrawerChange | string | null | null | The open panel's id. |
sidebarCollapsed · defaultSidebarCollapsed · onSidebarCollapsedChange | boolean | false | The rail. Persist it in the user's settings. |
banners | ReactNode | — | Page banners: Alerts with variant="banner". |
notifications | ReactNode | — | Page messages, above the page header. |
density | "compact" | "default" | "comfortable" | "inherit" | "compact" | The frame's density: consoles are dense. |
mainId | string | "main" | The main region's id, for the skip link. |
embedded | boolean | false | A shell inside a page, a preview: it fills its box, with no <main> or skip link; its layout follows the box. |
useAppShell() | { collapsed } | — | The shell's state, for content in its bar or sidebar. |
03
Parts
Each part carries a data-slot, for tests and placement.
| data-slot | Element | What it is |
|---|---|---|
app-shell | <div> | The frame; 100dvh tall. |
app-shell-top | <div> | The bar. |
app-shell-nav | <div> | The navigation column, sticky. |
app-shell-collapse | <button> | Collapse, or Expand. |
app-shell-main | <main> | The page; a <div> when embedded. |
app-shell-panel | <aside> | An open panel; a drawer under 1200px. |
04
Around your routes
Put the shell in the root layout, so it survives navigation and the rail keeps its state.
export const Route = createRootRoute({
component: () => (
<AppShell topBar={<ConsoleTopBar />} sidebar={<ConsoleSidebar />} drawers={drawers}>
<Outlet />
</AppShell>
),
});