App Shell

AppShell is the full-height frame a screen sits in: the Sidebar and the page, in the app's visual direction (inset, flat, frame or canvas) set by one prop.

Projects

12 active projects, 3 due this week.

tsx
import { RiDashboardLine, RiFolder3Line, RiSettings3Line } from '@remixicon/react';
import { AppShell } from '@/components/ui/wideset/app-shell/AppShell';
import { Button } from '@/components/ui/wideset/button/Button';
import { Sidebar } from '@/components/ui/wideset/sidebar/Sidebar';

<AppShell
  className="border-ws-static-base rounded-ws-container-md h-[24rem] w-full overflow-hidden border"
>
  <Sidebar>
    <Sidebar.Header>
      <div className="gap-ws-7 py-ws-3 flex items-center">
        <Sidebar.Expanded>
          <span className="typography-label-strong-sm text-ws-static-strong pl-ws-5">
            Northwind
          </span>
        </Sidebar.Expanded>
        <Sidebar.Trigger />
      </div>
    </Sidebar.Header>
    <Sidebar.Section>
      <nav aria-label="Main" className="gap-ws-2 flex flex-col">
        <Sidebar.Item href="#" icon={RiDashboardLine} label="Dashboard" />
        <Sidebar.Item href="#" icon={RiFolder3Line} label="Projects" active />
        <Sidebar.Item href="#" icon={RiSettings3Line} label="Settings" />
      </nav>
    </Sidebar.Section>
  </Sidebar>
  <AppShell.Main>
    <div className="gap-ws-11 p-ws-12 flex flex-col">
      <header className="gap-ws-9 flex items-center justify-between">
        <h1 className="typography-title-md text-ws-static-strong">Projects</h1>
        <Button size="sm">New project</Button>
      </header>
      <p className="typography-body-md text-ws-static-subtle">
        12 active projects, 3 due this week.
      </p>
    </div>
  </AppShell.Main>
</AppShell>

Installation

pnpm dlx wideset add app-shell

Copies the component and any Wideset components it uses into your project.

Examples

Directions

Pick one direction for the whole app, by what the app is, and keep it on every screen. Inset, the default, suits apps with navigation and several regions (a calendar, a document): the page is a raised card on the grey app frame. Flat suits simple, dense tools: one white surface split by a line. Frame suits side-by-side panels (messages, mail): the sidebar on a grey tint, the page full-bleed. Canvas suits pages made of separate modules (an overview, a wallet): the page stays grey and the content sits in white sections. The Sidebar inside takes the matching surface on its own; pass nothing to it.

tsx
import { RiCalendarLine, RiInboxLine, RiTeamLine } from '@remixicon/react';
import { AppShell } from '@/components/ui/wideset/app-shell/AppShell';
import { Sidebar } from '@/components/ui/wideset/sidebar/Sidebar';

const directions = ['inset', 'flat', 'frame', 'canvas'] as const;

export default function AppShellDirections() {
  return (
    <div className="gap-ws-12 flex w-full flex-col">
      {directions.map((direction) => (
        <AppShell
          key={direction}
          direction={direction}
          className="border-ws-static-base rounded-ws-container-md h-[18rem] w-full overflow-hidden border"
        >
          <Sidebar>
            <Sidebar.Header>
              <div className="typography-label-strong-sm text-ws-static-strong py-ws-3 pl-ws-5">
                Northwind
              </div>
            </Sidebar.Header>
            <Sidebar.Section>
              <nav aria-label={`Main, ${direction}`} className="gap-ws-2 flex flex-col">
                <Sidebar.Item href="#" icon={RiInboxLine} label="Inbox" />
                <Sidebar.Item href="#" icon={RiCalendarLine} label="Calendar" active />
                <Sidebar.Item href="#" icon={RiTeamLine} label="Team" />
              </nav>
            </Sidebar.Section>
          </Sidebar>
          <AppShell.Main>
            {direction === 'canvas' ? (
              <div className="p-ws-7 flex flex-col">
                <section className="bg-ws-static-foreground rounded-ws-container-md gap-ws-5 p-ws-12 flex flex-col">
                  <h2 className="typography-subtitle-md text-ws-static-strong capitalize">
                    {direction}
                  </h2>
                  <p className="typography-body-md text-ws-static-subtle">
                    Weekly planning, Thursday 10:00. Three meetings left this week.
                  </p>
                </section>
              </div>
            ) : (
              <div className="gap-ws-5 p-ws-12 flex flex-col">
                <h2 className="typography-subtitle-md text-ws-static-strong capitalize">
                  {direction}
                </h2>
                <p className="typography-body-md text-ws-static-subtle">
                  Weekly planning, Thursday 10:00. Three meetings left this week.
                </p>
              </div>
            )}
          </AppShell.Main>
        </AppShell>
      ))}
    </div>
  );
}

API reference

AppShell

NameDescriptionDefault
children

A `Sidebar` (or another navigation) followed by `AppShell.Main`.

ReactNode
—
direction

The app's visual direction, chosen once for the whole app. A `Sidebar` inside takes the matching surface on its own; its `surface` prop overrides it. `inset`: the sidebar on the grey app frame, the page a raised white card inside it. The default, for apps with navigation and several regions. `flat`: one white surface; a line splits the sidebar from the page. For simple, dense tools. `frame`: the sidebar on a grey tint, the page white and full-bleed. For side-by-side panels. `canvas`: a grey page whose content sits in white sections, usually under a top bar. For pages made of separate modules (an overview, a wallet).

AppShellDirection
'inset'
Every other prop of <div> is passed through to it. See MDN: <div>.

AppShell.Main

NameDescriptionDefault
children

The page: its header and content. `AppShell.Main` is its only scroll container.

ReactNode
—
Every other prop of <element> is passed through to it. See MDN: global attributes.

Accessibility

  • AppShell.Main is the page’s main landmark: one per page, with one h1 inside.
  • Wrap the sidebar’s items in <nav aria-label="…">; neither AppShell nor Sidebar is a landmark.
PartRendersDescription
AppShell<div>Props for the full-height row that holds the `Sidebar` and `AppShell.Main`.
AppShell.Main<element>Props for the page area: a `<main>` styled for the shell's direction.

Projects

12 active projects, 3 due this week.

tsx
import { RiDashboardLine, RiFolder3Line, RiSettings3Line } from '@remixicon/react';
import { AppShell } from '@/components/ui/wideset/app-shell/AppShell';
import { Button } from '@/components/ui/wideset/button/Button';
import { Sidebar } from '@/components/ui/wideset/sidebar/Sidebar';

<AppShell
  className="border-ws-static-base rounded-ws-container-md h-[24rem] w-full overflow-hidden border"
>
  <Sidebar>
    <Sidebar.Header>
      <div className="gap-ws-7 py-ws-3 flex items-center">
        <Sidebar.Expanded>
          <span className="typography-label-strong-sm text-ws-static-strong pl-ws-5">
            Northwind
          </span>
        </Sidebar.Expanded>
        <Sidebar.Trigger />
      </div>
    </Sidebar.Header>
    <Sidebar.Section>
      <nav aria-label="Main" className="gap-ws-2 flex flex-col">
        <Sidebar.Item href="#" icon={RiDashboardLine} label="Dashboard" />
        <Sidebar.Item href="#" icon={RiFolder3Line} label="Projects" active />
        <Sidebar.Item href="#" icon={RiSettings3Line} label="Settings" />
      </nav>
    </Sidebar.Section>
  </Sidebar>
  <AppShell.Main>
    <div className="gap-ws-11 p-ws-12 flex flex-col">
      <header className="gap-ws-9 flex items-center justify-between">
        <h1 className="typography-title-md text-ws-static-strong">Projects</h1>
        <Button size="sm">New project</Button>
      </header>
      <p className="typography-body-md text-ws-static-subtle">
        12 active projects, 3 due this week.
      </p>
    </div>
  </AppShell.Main>
</AppShell>

Appearance

Direction