---
title: "Build the app shell"
description: "Wrap your signed-in pages in <AppShell>: a header with your brand, the workspace switcher, the notification bell and the account menu, the app-wide notices, and your page in the main landmark."
canonical_url: "https://nuxt-backend.dev/docs/build/ui/app-shell"
---
# Build the app shell

> Wrap your signed-in pages in <AppShell>: a header with your brand, the workspace switcher, the notification bell and the account menu, the app-wide notices, and your page in the main landmark.

Version: nuxt-backend 0.6.x · Tab: Build · Kind: how-to · Status: stable

Every page: [llms.txt](https://nuxt-backend.dev/llms.txt) · Skill for coding agents: [nuxt-backend](https://nuxt-backend.dev/.well-known/skills/nuxt-backend/SKILL.md)

Commands use npm; use your project's package manager.

The shell is what sits around every page of a signed-in app: who you are, which workspace you are in, what is new, and the way to your account. `<AppShell>` is that frame as one component. Wrap your layout in it and the header, the notices and the main landmark are in place, reading the same session as the packaged pages. Your brand and your navigation go in its slots. Nuxt gives you layouts; the package adds the shell's parts, each reading live state: the workspaces, the unread notifications and the account.

## Wrap your layout

```vue [app/layouts/default.vue]
<template>
  <AppShell>
    <template #brand>
      <NuxtLink to="/">Panels</NuxtLink>
    </template>
    <template #nav>
      <NuxtLink to="/strips">Strips</NuxtLink>
      <NuxtLink to="/drafts">Drafts</NuxtLink>
    </template>
    <slot />
  </AppShell>
</template>
```

Signed out, the shell shows your brand and a sign-in link to the [sign-in page](https://nuxt-backend.dev/docs/build/ui/pages), wherever you moved it. Signed in, it adds the parts below. `npx nuxt module add nuxt-backend` writes a layout like this one into a new app, where it replaces Nuxt's welcome screen; `npx nuxt-backend init` restores it if it goes missing. A layout you already edited is left alone.

## What it renders

<table>
<thead>
  <tr>
    <th>
      Region
    </th>
    
    <th>
      What it shows
    </th>
    
    <th>
      What a person can do
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        brand
      </code>
      
       slot
    </td>
    
    <td>
      Your logo and name, linking home
    </td>
    
    <td>
      Go home
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        nav
      </code>
      
       slot
    </td>
    
    <td>
      Your app's own links
    </td>
    
    <td>
      Move around your app
    </td>
  </tr>
  
  <tr>
    <td>
      Workspace switcher
    </td>
    
    <td>
      The active workspace, the person's role in each of theirs, and the invitations waiting
    </td>
    
    <td>
      Switch the active workspace, or create one in place
    </td>
  </tr>
  
  <tr>
    <td>
      Notification bell
    </td>
    
    <td>
      The number of unread <a href="https://nuxt-backend.dev/docs/build/email/notifications">
        in-app notifications
      </a>
      
      , in its accessible name too, once the app uses them
    </td>
    
    <td>
      Open the list and mark what they read
    </td>
  </tr>
  
  <tr>
    <td>
      Account menu
    </td>
    
    <td>
      The person's avatar, name and links to their profile, security and settings; an admin console link for administrators
    </td>
    
    <td>
      Reach their account pages, or sign out
    </td>
  </tr>
  
  <tr>
    <td>
      Notices
    </td>
    
    <td>
      <a href="https://nuxt-backend.dev/docs/build/ui/notices">
        <code>
          <BackendNotices>
        </code>
      </a>
      
      , under the header
    </td>
    
    <td>
      Act on a notice
    </td>
  </tr>
  
  <tr>
    <td>
      default slot
    </td>
    
    <td>
      Your page, inside <code>
        <main>
      </code>
    </td>
    
    <td>
      Everything else
    </td>
  </tr>
</tbody>
</table>

The menus are disclosures on the browser's own popover, placed with CSS anchor positioning: Escape closes them, and focus returns to the button that opened them. The shell keeps the [component contract](https://nuxt-backend.dev/docs/reference/components#the-component-contract): a `data-shell` family the stylesheet themes, typed slots, a state for everything it waits on, and its words from the `shell` label group.

## Workspaces in the switcher

The switcher lists the workspaces the person belongs to, with their role in each, and the invitations waiting for them. Switching sets the active workspace for the session, and with it the billing entity, the credits and every workspace-scoped query on the page. Creating one in place makes it active. A creation the server refuses is announced as an alert and changes nothing ([Workspaces](https://nuxt-backend.dev/docs/build/auth/workspaces)). Each workspace's role is read when the menu opens, so the list may fill in a moment after it appears.

An app whose people never share a workspace can hide it: `<AppShell :switcher="false">`. Each account still has its personal workspace, out of sight.

## On the packaged pages

The packaged pages render inside one [frame](https://nuxt-backend.dev/docs/build/ui/pages#the-frame). Inside a layout with `<AppShell>`, they leave the header, the notices and the main landmark to the shell, so nothing shows twice. A page of yours that [replaces one](https://nuxt-backend.dev/docs/build/ui/customize/parts#replace-a-page) does the same.

## Customize it

The shell climbs the same [ladder](https://nuxt-backend.dev/docs/build/ui/customize) as every packaged component. Its tokens restyle it with the rest, the `shell` label group words it in every language, and the `brand`, `nav` and `actions` slots take your own parts. `actions` sits before the bell, for a search button or a "New strip" link. A component of yours named `AccountMenu` or `WorkspaceSwitcher` replaces that part, and `useAppShell()` gives a header of your own the same state: the signed-in account, the menu's links, `signOut()` and the switcher.

## What happens when…

<table>
<thead>
  <tr>
    <th>
      Situation
    </th>
    
    <th>
      Result
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      The person is signed out
    </td>
    
    <td>
      Only your brand, your <code>
        nav
      </code>
      
       slot and a sign-in link
    </td>
  </tr>
  
  <tr>
    <td>
      Notifications are not set up
    </td>
    
    <td>
      No bell
    </td>
  </tr>
  
  <tr>
    <td>
      The account is not an administrator
    </td>
    
    <td>
      No admin console link in the menu
    </td>
  </tr>
  
  <tr>
    <td>
      Switching workspaces fails
    </td>
    
    <td>
      The switcher keeps the old one active and announces the failure as an alert
    </td>
  </tr>
</tbody>
</table>

## Limits

- **One shell per layout.** Nest your page's own header inside the default slot, not around the shell.
- **The parts are swappable.** Each region is a [part](https://nuxt-backend.dev/docs/build/ui/customize/parts), such as the account menu, so you can replace one without the rest.

## Test it

Sign in, switch workspaces from the switcher, and check that every workspace-scoped list on the page follows. With a keyboard only, open each menu, close it with Escape, and check that focus returns to its button.

## Related

- [Packaged pages](https://nuxt-backend.dev/docs/build/ui/pages): the frame and its regions.
- [Show app-wide notices](https://nuxt-backend.dev/docs/build/ui/notices): what the shell renders under its header.
- [Create and switch workspaces](https://nuxt-backend.dev/docs/build/auth/workspaces): the active workspace, and switching it.
- [Accessibility](https://nuxt-backend.dev/docs/build/ui/accessibility): what every packaged component guarantees.


## Sitemap

See the full [sitemap](https://nuxt-backend.dev/sitemap.md) for all pages.
