> For AI agents: the complete documentation index is available at https://wallarm.github.io/design-system/llms.txt, the full documentation bundle is available at https://wallarm.github.io/design-system/llms-full.txt.

# Application layout

**Components:** [`AppShell`](https://wallarm.github.io/design-system/components/app-shell.md), [`AppShellHeader`](https://wallarm.github.io/design-system/components/app-shell.md), [`AppShellRail`](https://wallarm.github.io/design-system/components/app-shell.md), [`AppShellRemote`](https://wallarm.github.io/design-system/components/app-shell.md), [`AppShellAside`](https://wallarm.github.io/design-system/components/app-shell.md), `TopHeader`, `TopHeaderLogo`, `TopHeaderActions`


+23 more

`TopHeaderSeparator`, [`NotificationCenter`](https://wallarm.github.io/design-system/components/notification-center.md), [`NotificationCenterTrigger`](https://wallarm.github.io/design-system/components/notification-center.md), [`ChatTrigger`](https://wallarm.github.io/design-system/components/chat.md), [`DropdownMenu`](https://wallarm.github.io/design-system/components/dropdown-menu.md), `NavRail`, `NavRailBody`, `NavRailItem`, `NavRailSeparator`, `NavRailFooter`, `NavRailSkeleton`, [`RemoteShell`](https://wallarm.github.io/design-system/components/remote-shell.md), [`RemoteShellPanel`](https://wallarm.github.io/design-system/components/remote-shell.md), [`RemoteShellBreadcrumb`](https://wallarm.github.io/design-system/components/remote-shell.md), [`RemoteShellContent`](https://wallarm.github.io/design-system/components/remote-shell.md), [`Page`](https://wallarm.github.io/design-system/components/page.md), [`PageHeader`](https://wallarm.github.io/design-system/components/page.md), [`PageTitle`](https://wallarm.github.io/design-system/components/page.md), [`PageContent`](https://wallarm.github.io/design-system/components/page.md), [`Breadcrumbs`](https://wallarm.github.io/design-system/components/breadcrumbs.md), [`UtilityPage`](https://wallarm.github.io/design-system/components/utility-page.md), [`SplashScreen`](https://wallarm.github.io/design-system/components/splash-screen.md), [`Skeleton`](https://wallarm.github.io/design-system/components/skeleton.md)

Two shells: `AppShell` (the host's chrome) and `RemoteShell` (a product's chrome, built from a `NavConfig`).

## When to use

| Need                                                                | Use                                                                                                             | Not                                                   |
| ------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------- |
| The console frame: top bar, product rail, content surface           | `AppShell` › `AppShellHeader` + `AppShellRail` + `AppShellRemote`, rendered once by the host                    | An `AppShell` per page, or a hand-made grid           |
| A product with its own menu                                         | `RemoteShell config={navConfig}` › `RemoteShellPanel` + `RemoteShellBreadcrumb` + `RemoteShellContent` › `Page` | Hand-built panel markup, or `AppShell` in the product |
| A product inside a host group                                       | Content only; the host wraps the group in one `RemoteShell`                                                     | A second `RemoteShell` in the product                 |
| A host-local section (Settings)                                     | `RemoteShell` in the host route, with its own `NavConfig`                                                       | A remote for it                                       |
| A product with one page                                             | `RemoteShell` without `RemoteShellPanel`, or content only                                                       | An empty `NavConfig`                                  |
| Home or a cross-product page                                        | `Page` directly in `AppShellRemote`                                                                             | `RemoteShell` with an empty config                    |
| The app cannot render (unknown URL, 500, offline, no tenant access) | `UtilityPage` instead of the shell                                                                              | `UtilityPage` inside `AppShellRemote`                 |
| Cold start                                                          | `SplashScreen`, then `<AppShell reveal>`                                                                        | A `Loader` on a blank page                            |

Pick the `NavConfig` node by what the entry does:

| Entry                                  | Node                                                                 | Not                           |
| -------------------------------------- | -------------------------------------------------------------------- | ----------------------------- |
| A page                                 | `type: 'link'` with `path` (a bare segment, no slash)                | A `group` with one child      |
| Nested pages with no page of their own | `type: 'group'`; `defaultExpanded` on the one holding the usual page | `drill`                       |
| Pick an entity, then its sub-pages     | `type: 'drill'` with `param`, `entities` and `children`              | A `Select` in the page header |
| A label over a run of entries          | `type: 'section-header'`                                             | A disabled link               |
| A line between entries                 | `dividerAfter: true` on the entry above                              | An empty link                 |

## Rules

**Ownership**

- The host renders `AppShell` once at the root. It owns the product list in `NavRail` and knows nothing about a product's routes.
- The product owns its `NavConfig` (next to its routes) and renders its own `RemoteShell`. **Never** render `AppShell`, `TopHeader` or `NavRail` in a product.
- A product in a host group renders content only. The host draws the group `RemoteShell` for two or more children.

**Header and rail footer**

- Settings is a `NavRailItem` in `NavRailFooter`, never in the product panel or top header.
- The user menu is the last `NavRailFooter` item: an `avatar` `NavRailItem` in `DropdownMenuTrigger`.
- Notifications are a `NotificationCenter` in `TopHeaderActions`, never a hand-made bell and popover.
- `TopHeaderActions` order: search, `TopHeaderSeparator`, tenant switcher, `ChatTrigger`, `NotificationCenter`, help.

**URL is the only state**

- Pass the router's pathname to `pathname` and `onNavigate` to the router, always together.
- If the router has its own `basepath`, omit `basePath` on `RemoteShell`.
- The active item, drill level and trail come from `pathname`. **Never** keep them in state.
- Exactly one `NavRailItem` is `active`, from the first URL segment: Home on `/`, the product on `/edge/…`, Settings (in `NavRailFooter`) on `/settings/…`.

**Sizes (built in; do not override)**

- Top header 36px. Rail 48px collapsed, 184px expanded, 78px compact. Product panel 216px, 164–256px with `resizable`. Rail and panel items 32px.
- `AppShellRemote` owns the rounded surface and border. **Never** restyle it or add a `w-*` to the shell regions.
- Page gutters are 24px, owned by `Page` parts. **Never** pad `RemoteShellContent` or `AppShellRemote`.

**Scroll**

- The shell is `h-screen`. **Never** set `overflow` or `height` on `html` or `body`.
- The rail, the panel and `RemoteShellContent` scroll on their own. A table page uses `<Page fullSize fixedHeight>` so only `PageContent` scrolls.

**Breadcrumbs**

- In a product, the trail is `RemoteShellBreadcrumb`: product, groups as text, drills as a scope switcher, current page. **Never** also put `Breadcrumbs` in `PageHeader`.
- `RemoteShellBreadcrumb` ends at the last `NavConfig` entry. Past it (a record name), render your own `Breadcrumbs` from `useRemoteShellContext()`; a grouped product reports them through `@wallarm/sdk` `onBreadcrumbChange`.
- Trail-row controls are `RemoteShellBreadcrumb` children.
- Home and cross-product pages have no trail.

**Layering**

- In-shell sticky layers are `z-10`; overlays portal above the shell. **Never** add `z-*` to a shell region. See [Layering](https://wallarm.github.io/design-system/foundations/layering.md).

## Examples

A standalone product: header actions, Settings and the user menu in the rail footer, a `NavConfig` panel, trail and page.

A standalone product at `/edge/api-sessions`. The host renders `AppShell` with the product
list in `NavRail`; the product renders `RemoteShell` with its own `NavConfig`, and its page
goes in `RemoteShellContent`. The panel, the active item and the trail all come from
`pathname`.

```tsx
import { type MouseEvent, useState } from 'react';
import { AppShell, AppShellHeader, AppShellRail, AppShellRemote } from '@wallarm-org/design-system/AppShell';
import { Button } from '@wallarm-org/design-system/Button';
import { ChatTrigger } from '@wallarm-org/design-system/Chat';
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuItemIcon, DropdownMenuItemText, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuTrigger, DropdownMenuTriggerItem } from '@wallarm-org/design-system/DropdownMenu';
import { ChevronUpDown, CircleHelp, History, Home as HomeIcon, LogOut, Paintbrush, PanelLeftDashed, Search, Settings, UserRound } from '@wallarm-org/design-system/icons';
import { Logo } from '@wallarm-org/design-system/Logo';
import { NavRail, NavRailBody, NavRailFooter, NavRailItem, type NavRailMode, NavRailSeparator } from '@wallarm-org/design-system/NavRail';
import { NotificationCenter, NotificationCenterBody, NotificationCenterContent, NotificationCenterHeader, NotificationCenterHeaderAction, NotificationCenterHeaderActions, NotificationCenterItem, NotificationCenterItemDescription, NotificationCenterItemTime, NotificationCenterItemTitle, NotificationCenterList, NotificationCenterTabs, NotificationCenterTabsList, NotificationCenterTitle, NotificationCenterTrigger } from '@wallarm-org/design-system/NotificationCenter';
import { NumericBadge } from '@wallarm-org/design-system/NumericBadge';
import { Page, PageContent, PageHeader, PageTitle } from '@wallarm-org/design-system/Page';
import { RemoteShell, RemoteShellBreadcrumb, RemoteShellContent, RemoteShellPanel } from '@wallarm-org/design-system/RemoteShell';
import { type TableColumnDef, Table } from '@wallarm-org/design-system/Table';
import { TabsContent, TabsTrigger } from '@wallarm-org/design-system/Tabs';
import { useTheme } from '@wallarm-org/design-system/ThemeProvider';
import { TopHeader, TopHeaderActions, TopHeaderLogo, TopHeaderSeparator } from '@wallarm-org/design-system/TopHeader';

export const Default = () => {
  const [pathname, setPathname] = useState('/edge/api-sessions');
  const [railMode, setRailMode] = useState<NavRailMode>('collapsed');
  const { theme, setTheme } = useTheme();
  const unread = NOTIFICATIONS.filter(item => item.unread);
  const read = NOTIFICATIONS.filter(item => !item.unread);

  const handleRailClick = (event: MouseEvent<HTMLAnchorElement>) => {
    event.preventDefault();
    onRailNavigate(event.currentTarget.getAttribute('href'));
  };
  const handleNavigate = (to: string) => {
    onNavigate(to);
    setPathname(to);
  };
  const handleRailModeChange = ({ value }: { value: string }) => {
    const next = RAIL_MODES.find(mode => mode === value);
    if (next) setRailMode(next);
  };
  const handleThemeChange = ({ value }: { value: string }) => {
    const next = THEMES.find(option => option === value);
    if (next) setTheme(next);
  };

  const columns: TableColumnDef<ApiSession>[] = [
    { accessorKey: 'id', header: 'Session', size: 160 },
    { accessorKey: 'application', header: 'Application', size: 240 },
    { accessorKey: 'requests', header: 'Requests', size: 120 },
    { accessorKey: 'started', header: 'Started', size: 200 },
  ];

  return (
    <AppShell data-testid='app-shell'>
      <AppShellHeader>
        <TopHeader data-testid='top-header'>
          <TopHeaderLogo href='/' onClick={handleRailClick}>
            <Logo size='md' />
          </TopHeaderLogo>
          <TopHeaderActions>
            <Button variant='ghost' color='neutral' size='small' aria-label='Search'>
              <Search />
            </Button>
            <TopHeaderSeparator />
            <Button variant='ghost' color='neutral' size='small'>
              Acme Bank
              <ChevronUpDown />
            </Button>
            <ChatTrigger onClick={onOpenAssistant} />
            <NotificationCenter data-testid='notifications'>
              <NotificationCenterTrigger count={unread.length} />
              <NotificationCenterContent>
                <NotificationCenterHeader>
                  <NotificationCenterTitle />
                  <NotificationCenterHeaderActions>
                    <NotificationCenterHeaderAction onClick={onMarkAllRead}>
                      Mark all as read
                    </NotificationCenterHeaderAction>
                    <NotificationCenterHeaderAction asChild aria-label='Notification settings'>
                      <a href='/settings/notifications' onClick={handleRailClick}>
                        <Settings />
                      </a>
                    </NotificationCenterHeaderAction>
                  </NotificationCenterHeaderActions>
                </NotificationCenterHeader>
                <NotificationCenterTabs defaultValue='new'>
                  <NotificationCenterTabsList>
                    <TabsTrigger value='new'>
                      New <NumericBadge size='small'>{unread.length}</NumericBadge>
                    </TabsTrigger>
                    <TabsTrigger value='read'>Read</TabsTrigger>
                  </NotificationCenterTabsList>
                  <TabsContent value='new'>
                    <NotificationCenterBody>
                      <NotificationCenterList>
                        {unread.map(item => (
                          <NotificationCenterItem key={item.id} unread>
                            <NotificationCenterItemTitle onClick={onOpenNotification}>
                              {item.title}
                            </NotificationCenterItemTitle>
                            <NotificationCenterItemTime value={item.createdAt} />
                            <NotificationCenterItemDescription>
                              {item.description}
                            </NotificationCenterItemDescription>
                          </NotificationCenterItem>
                        ))}
                      </NotificationCenterList>
                    </NotificationCenterBody>
                  </TabsContent>
                  <TabsContent value='read'>
                    <NotificationCenterBody>
                      <NotificationCenterList>
                        {read.map(item => (
                          <NotificationCenterItem key={item.id}>
                            <NotificationCenterItemTitle onClick={onOpenNotification}>
                              {item.title}
                            </NotificationCenterItemTitle>
                            <NotificationCenterItemTime value={item.createdAt} />
                            <NotificationCenterItemDescription>
                              {item.description}
                            </NotificationCenterItemDescription>
                          </NotificationCenterItem>
                        ))}
                      </NotificationCenterList>
                    </NotificationCenterBody>
                  </TabsContent>
                </NotificationCenterTabs>
              </NotificationCenterContent>
            </NotificationCenter>
            <Button variant='ghost' color='neutral' size='small' aria-label='Help'>
              <CircleHelp />
            </Button>
          </TopHeaderActions>
        </TopHeader>
      </AppShellHeader>

      <AppShellRail>
        <NavRail mode={railMode} data-testid='nav-rail'>
          <NavRailBody>
            <NavRailItem
              href='/'
              icon={HomeIcon}
              label='Home'
              shortcut={['G', 'H']}
              onClick={handleRailClick}
              data-testid='nav-rail-home'
            />
            <NavRailItem href='/recent' icon={History} label='Recent' onClick={handleRailClick} />
            <NavRailSeparator />
            {PRODUCTS.map(product => (
              <NavRailItem
                key={product.id}
                href={`/${product.id}`}
                icon={product.icon}
                label={product.label}
                shortcut={product.shortcut}
                active={product.id === 'edge'}
                onClick={handleRailClick}
                data-testid={`nav-rail-${product.id}`}
              />
            ))}
          </NavRailBody>
          <NavRailFooter>
            <NavRailItem
              href='/settings'
              icon={Settings}
              label='Settings'
              shortcut={['G', 'S']}
              onClick={handleRailClick}
              data-testid='nav-rail-settings'
            />
            <DropdownMenu
              data-testid='account-menu'
              positioning={{ placement: 'right-end', gutter: 6, offset: { crossAxis: 12 } }}
            >
              <DropdownMenuTrigger>
                <NavRailItem
                  icon={UserRound}
                  label='Maria Lopez'
                  avatar
                  data-testid='nav-rail-account'
                />
              </DropdownMenuTrigger>
              <DropdownMenuContent className='w-200'>
                <DropdownMenuItem onSelect={onOpenProfile}>
                  <DropdownMenuItemIcon>
                    <Settings />
                  </DropdownMenuItemIcon>
                  <DropdownMenuItemText>Profile settings</DropdownMenuItemText>
                </DropdownMenuItem>
                <DropdownMenu>
                  <DropdownMenuTriggerItem>
                    <DropdownMenuItemIcon>
                      <Paintbrush />
                    </DropdownMenuItemIcon>
                    <DropdownMenuItemText>Appearance</DropdownMenuItemText>
                  </DropdownMenuTriggerItem>
                  <DropdownMenuContent>
                    <DropdownMenuRadioGroup value={theme} onValueChange={handleThemeChange}>
                      {THEMES.map(option => (
                        <DropdownMenuRadioItem key={option} value={option}>
                          <DropdownMenuItemText>{THEME_LABELS[option]}</DropdownMenuItemText>
                        </DropdownMenuRadioItem>
                      ))}
                    </DropdownMenuRadioGroup>
                  </DropdownMenuContent>
                </DropdownMenu>
                <DropdownMenu>
                  <DropdownMenuTriggerItem>
                    <DropdownMenuItemIcon>
                      <PanelLeftDashed />
                    </DropdownMenuItemIcon>
                    <DropdownMenuItemText>Sidebar mode</DropdownMenuItemText>
                  </DropdownMenuTriggerItem>
                  <DropdownMenuContent>
                    <DropdownMenuRadioGroup value={railMode} onValueChange={handleRailModeChange}>
                      {RAIL_MODES.map(option => (
                        <DropdownMenuRadioItem key={option} value={option}>
                          <DropdownMenuItemText>{RAIL_MODE_LABELS[option]}</DropdownMenuItemText>
                        </DropdownMenuRadioItem>
                      ))}
                    </DropdownMenuRadioGroup>
                  </DropdownMenuContent>
                </DropdownMenu>
                <DropdownMenuSeparator />
                <DropdownMenuItem onSelect={onSignOut}>
                  <DropdownMenuItemIcon>
                    <LogOut />
                  </DropdownMenuItemIcon>
                  <DropdownMenuItemText>Sign out</DropdownMenuItemText>
                </DropdownMenuItem>
              </DropdownMenuContent>
            </DropdownMenu>
          </NavRailFooter>
        </NavRail>
      </AppShellRail>

      <AppShellRemote role='main'>
        <RemoteShell
          config={EDGE_NAV}
          basePath='/edge'
          pathname={pathname}
          onNavigate={handleNavigate}
          data-testid='product-shell'
        >
          <RemoteShellPanel resizable />
          <RemoteShellBreadcrumb />
          <RemoteShellContent>
            <Page name='edge-api-sessions' fullSize fixedHeight data-testid='sessions-page'>
              <PageHeader>
                <PageTitle>API Sessions</PageTitle>
              </PageHeader>
              <PageContent>
                <Table
                  aria-label='API sessions'
                  data={API_SESSIONS}
                  columns={columns}
                  data-testid='sessions-table'
                />
              </PageContent>
            </Page>
          </RemoteShellContent>
        </RemoteShell>
      </AppShellRemote>
    </AppShell>
  );
};
```

Home: a page straight in `AppShellRemote`, expanded rail, no panel.

Home is a host page, not a product: `Page` goes straight into `AppShellRemote`, with no
`RemoteShell`, no panel and no breadcrumbs. The rail is expanded at the top level.

```tsx
import { type MouseEvent, useState } from 'react';
import { AppShell, AppShellHeader, AppShellRail, AppShellRemote } from '@wallarm-org/design-system/AppShell';
import { Button } from '@wallarm-org/design-system/Button';
import { ChatTrigger } from '@wallarm-org/design-system/Chat';
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuItemIcon, DropdownMenuItemText, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuTrigger, DropdownMenuTriggerItem } from '@wallarm-org/design-system/DropdownMenu';
import { ChevronUpDown, CircleHelp, History, Home as HomeIcon, LogOut, Paintbrush, PanelLeftDashed, Search, Settings, UserRound } from '@wallarm-org/design-system/icons';
import { Logo } from '@wallarm-org/design-system/Logo';
import { NavRail, NavRailBody, NavRailFooter, NavRailItem, type NavRailMode, NavRailSeparator } from '@wallarm-org/design-system/NavRail';
import { NotificationCenter, NotificationCenterBody, NotificationCenterContent, NotificationCenterHeader, NotificationCenterHeaderAction, NotificationCenterHeaderActions, NotificationCenterItem, NotificationCenterItemDescription, NotificationCenterItemTime, NotificationCenterItemTitle, NotificationCenterList, NotificationCenterTabs, NotificationCenterTabsList, NotificationCenterTitle, NotificationCenterTrigger } from '@wallarm-org/design-system/NotificationCenter';
import { NumericBadge } from '@wallarm-org/design-system/NumericBadge';
import { Page, PageContent, PageHeader, PageTitle } from '@wallarm-org/design-system/Page';
import { TabsContent, TabsTrigger } from '@wallarm-org/design-system/Tabs';
import { Text } from '@wallarm-org/design-system/Text';
import { useTheme } from '@wallarm-org/design-system/ThemeProvider';
import { TopHeader, TopHeaderActions, TopHeaderLogo, TopHeaderSeparator } from '@wallarm-org/design-system/TopHeader';

export const Home = () => {
  const [railMode, setRailMode] = useState<NavRailMode>('expanded');
  const { theme, setTheme } = useTheme();
  const unread = NOTIFICATIONS.filter(item => item.unread);
  const read = NOTIFICATIONS.filter(item => !item.unread);
  const handleRailClick = (event: MouseEvent<HTMLAnchorElement>) => {
    event.preventDefault();
    onRailNavigate(event.currentTarget.getAttribute('href'));
  };
  const handleRailModeChange = ({ value }: { value: string }) => {
    const next = RAIL_MODES.find(mode => mode === value);
    if (next) setRailMode(next);
  };
  const handleThemeChange = ({ value }: { value: string }) => {
    const next = THEMES.find(option => option === value);
    if (next) setTheme(next);
  };

  return (
    <AppShell data-testid='app-shell'>
      <AppShellHeader>
        <TopHeader data-testid='top-header'>
          <TopHeaderLogo href='/' onClick={handleRailClick}>
            <Logo size='md' />
          </TopHeaderLogo>
          <TopHeaderActions>
            <Button variant='ghost' color='neutral' size='small' aria-label='Search'>
              <Search />
            </Button>
            <TopHeaderSeparator />
            <Button variant='ghost' color='neutral' size='small'>
              Acme Bank
              <ChevronUpDown />
            </Button>
            <ChatTrigger onClick={onOpenAssistant} />
            <NotificationCenter data-testid='notifications'>
              <NotificationCenterTrigger count={unread.length} />
              <NotificationCenterContent>
                <NotificationCenterHeader>
                  <NotificationCenterTitle />
                  <NotificationCenterHeaderActions>
                    <NotificationCenterHeaderAction onClick={onMarkAllRead}>
                      Mark all as read
                    </NotificationCenterHeaderAction>
                    <NotificationCenterHeaderAction asChild aria-label='Notification settings'>
                      <a href='/settings/notifications' onClick={handleRailClick}>
                        <Settings />
                      </a>
                    </NotificationCenterHeaderAction>
                  </NotificationCenterHeaderActions>
                </NotificationCenterHeader>
                <NotificationCenterTabs defaultValue='new'>
                  <NotificationCenterTabsList>
                    <TabsTrigger value='new'>
                      New <NumericBadge size='small'>{unread.length}</NumericBadge>
                    </TabsTrigger>
                    <TabsTrigger value='read'>Read</TabsTrigger>
                  </NotificationCenterTabsList>
                  <TabsContent value='new'>
                    <NotificationCenterBody>
                      <NotificationCenterList>
                        {unread.map(item => (
                          <NotificationCenterItem key={item.id} unread>
                            <NotificationCenterItemTitle onClick={onOpenNotification}>
                              {item.title}
                            </NotificationCenterItemTitle>
                            <NotificationCenterItemTime value={item.createdAt} />
                            <NotificationCenterItemDescription>
                              {item.description}
                            </NotificationCenterItemDescription>
                          </NotificationCenterItem>
                        ))}
                      </NotificationCenterList>
                    </NotificationCenterBody>
                  </TabsContent>
                  <TabsContent value='read'>
                    <NotificationCenterBody>
                      <NotificationCenterList>
                        {read.map(item => (
                          <NotificationCenterItem key={item.id}>
                            <NotificationCenterItemTitle onClick={onOpenNotification}>
                              {item.title}
                            </NotificationCenterItemTitle>
                            <NotificationCenterItemTime value={item.createdAt} />
                            <NotificationCenterItemDescription>
                              {item.description}
                            </NotificationCenterItemDescription>
                          </NotificationCenterItem>
                        ))}
                      </NotificationCenterList>
                    </NotificationCenterBody>
                  </TabsContent>
                </NotificationCenterTabs>
              </NotificationCenterContent>
            </NotificationCenter>
            <Button variant='ghost' color='neutral' size='small' aria-label='Help'>
              <CircleHelp />
            </Button>
          </TopHeaderActions>
        </TopHeader>
      </AppShellHeader>

      <AppShellRail>
        <NavRail mode={railMode} data-testid='nav-rail'>
          <NavRailBody>
            <NavRailItem
              href='/'
              icon={HomeIcon}
              label='Home'
              shortcut={['G', 'H']}
              active
              onClick={handleRailClick}
              data-testid='nav-rail-home'
            />
            <NavRailItem href='/recent' icon={History} label='Recent' onClick={handleRailClick} />
            <NavRailSeparator />
            {PRODUCTS.map(product => (
              <NavRailItem
                key={product.id}
                href={`/${product.id}`}
                icon={product.icon}
                label={product.label}
                shortcut={product.shortcut}
                onClick={handleRailClick}
                data-testid={`nav-rail-${product.id}`}
              />
            ))}
          </NavRailBody>
          <NavRailFooter>
            <NavRailItem
              href='/settings'
              icon={Settings}
              label='Settings'
              shortcut={['G', 'S']}
              onClick={handleRailClick}
              data-testid='nav-rail-settings'
            />
            <DropdownMenu
              data-testid='account-menu'
              positioning={{ placement: 'right-end', gutter: 6, offset: { crossAxis: 12 } }}
            >
              <DropdownMenuTrigger>
                <NavRailItem
                  icon={UserRound}
                  label='Maria Lopez'
                  avatar
                  data-testid='nav-rail-account'
                />
              </DropdownMenuTrigger>
              <DropdownMenuContent className='w-200'>
                <DropdownMenuItem onSelect={onOpenProfile}>
                  <DropdownMenuItemIcon>
                    <Settings />
                  </DropdownMenuItemIcon>
                  <DropdownMenuItemText>Profile settings</DropdownMenuItemText>
                </DropdownMenuItem>
                <DropdownMenu>
                  <DropdownMenuTriggerItem>
                    <DropdownMenuItemIcon>
                      <Paintbrush />
                    </DropdownMenuItemIcon>
                    <DropdownMenuItemText>Appearance</DropdownMenuItemText>
                  </DropdownMenuTriggerItem>
                  <DropdownMenuContent>
                    <DropdownMenuRadioGroup value={theme} onValueChange={handleThemeChange}>
                      {THEMES.map(option => (
                        <DropdownMenuRadioItem key={option} value={option}>
                          <DropdownMenuItemText>{THEME_LABELS[option]}</DropdownMenuItemText>
                        </DropdownMenuRadioItem>
                      ))}
                    </DropdownMenuRadioGroup>
                  </DropdownMenuContent>
                </DropdownMenu>
                <DropdownMenu>
                  <DropdownMenuTriggerItem>
                    <DropdownMenuItemIcon>
                      <PanelLeftDashed />
                    </DropdownMenuItemIcon>
                    <DropdownMenuItemText>Sidebar mode</DropdownMenuItemText>
                  </DropdownMenuTriggerItem>
                  <DropdownMenuContent>
                    <DropdownMenuRadioGroup value={railMode} onValueChange={handleRailModeChange}>
                      {RAIL_MODES.map(option => (
                        <DropdownMenuRadioItem key={option} value={option}>
                          <DropdownMenuItemText>{RAIL_MODE_LABELS[option]}</DropdownMenuItemText>
                        </DropdownMenuRadioItem>
                      ))}
                    </DropdownMenuRadioGroup>
                  </DropdownMenuContent>
                </DropdownMenu>
                <DropdownMenuSeparator />
                <DropdownMenuItem onSelect={onSignOut}>
                  <DropdownMenuItemIcon>
                    <LogOut />
                  </DropdownMenuItemIcon>
                  <DropdownMenuItemText>Sign out</DropdownMenuItemText>
                </DropdownMenuItem>
              </DropdownMenuContent>
            </DropdownMenu>
          </NavRailFooter>
        </NavRail>
      </AppShellRail>

      <AppShellRemote role='main'>
        <Page name='home' data-testid='home-page'>
          <PageHeader>
            <PageTitle>Good morning, Maria</PageTitle>
          </PageHeader>
          <PageContent>
            <Text size='sm' color='secondary'>
              3 new incidents and 1 node update since your last visit.
            </Text>
          </PageContent>
        </Page>
      </AppShellRemote>
    </AppShell>
  );
};
```

Notifications, open from the header bell.

The notifications inbox open from the bell in `TopHeaderActions`: unread count on the bell,
New and Read tabs. The app owns the list and the unread count.

```tsx
import { type MouseEvent, useState } from 'react';
import { AppShell, AppShellHeader, AppShellRail, AppShellRemote } from '@wallarm-org/design-system/AppShell';
import { Button } from '@wallarm-org/design-system/Button';
import { ChatTrigger } from '@wallarm-org/design-system/Chat';
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuItemIcon, DropdownMenuItemText, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuTrigger, DropdownMenuTriggerItem } from '@wallarm-org/design-system/DropdownMenu';
import { ChevronUpDown, CircleHelp, History, Home as HomeIcon, LogOut, Paintbrush, PanelLeftDashed, Search, Settings, UserRound } from '@wallarm-org/design-system/icons';
import { Logo } from '@wallarm-org/design-system/Logo';
import { NavRail, NavRailBody, NavRailFooter, NavRailItem, type NavRailMode, NavRailSeparator } from '@wallarm-org/design-system/NavRail';
import { NotificationCenter, NotificationCenterBody, NotificationCenterContent, NotificationCenterHeader, NotificationCenterHeaderAction, NotificationCenterHeaderActions, NotificationCenterItem, NotificationCenterItemDescription, NotificationCenterItemTime, NotificationCenterItemTitle, NotificationCenterList, NotificationCenterTabs, NotificationCenterTabsList, NotificationCenterTitle, NotificationCenterTrigger } from '@wallarm-org/design-system/NotificationCenter';
import { NumericBadge } from '@wallarm-org/design-system/NumericBadge';
import { Page, PageContent, PageHeader, PageTitle } from '@wallarm-org/design-system/Page';
import { TabsContent, TabsTrigger } from '@wallarm-org/design-system/Tabs';
import { Text } from '@wallarm-org/design-system/Text';
import { useTheme } from '@wallarm-org/design-system/ThemeProvider';
import { TopHeader, TopHeaderActions, TopHeaderLogo, TopHeaderSeparator } from '@wallarm-org/design-system/TopHeader';

export const NotificationsOpen = () => {
  const [railMode, setRailMode] = useState<NavRailMode>('expanded');
  const [notificationsOpen, setNotificationsOpen] = useState(true);
  const { theme, setTheme } = useTheme();
  const unread = NOTIFICATIONS.filter(item => item.unread);
  const read = NOTIFICATIONS.filter(item => !item.unread);
  const handleRailClick = (event: MouseEvent<HTMLAnchorElement>) => {
    event.preventDefault();
    onRailNavigate(event.currentTarget.getAttribute('href'));
  };
  const handleRailModeChange = ({ value }: { value: string }) => {
    const next = RAIL_MODES.find(mode => mode === value);
    if (next) setRailMode(next);
  };
  const handleThemeChange = ({ value }: { value: string }) => {
    const next = THEMES.find(option => option === value);
    if (next) setTheme(next);
  };

  return (
    <AppShell data-testid='app-shell'>
      <AppShellHeader>
        <TopHeader data-testid='top-header'>
          <TopHeaderLogo href='/' onClick={handleRailClick}>
            <Logo size='md' />
          </TopHeaderLogo>
          <TopHeaderActions>
            <Button variant='ghost' color='neutral' size='small' aria-label='Search'>
              <Search />
            </Button>
            <TopHeaderSeparator />
            <Button variant='ghost' color='neutral' size='small'>
              Acme Bank
              <ChevronUpDown />
            </Button>
            <ChatTrigger onClick={onOpenAssistant} />
            <NotificationCenter
              data-testid='notifications'
              open={notificationsOpen}
              onOpenChange={setNotificationsOpen}
            >
              <NotificationCenterTrigger count={unread.length} />
              <NotificationCenterContent>
                <NotificationCenterHeader>
                  <NotificationCenterTitle />
                  <NotificationCenterHeaderActions>
                    <NotificationCenterHeaderAction onClick={onMarkAllRead}>
                      Mark all as read
                    </NotificationCenterHeaderAction>
                    <NotificationCenterHeaderAction asChild aria-label='Notification settings'>
                      <a href='/settings/notifications' onClick={handleRailClick}>
                        <Settings />
                      </a>
                    </NotificationCenterHeaderAction>
                  </NotificationCenterHeaderActions>
                </NotificationCenterHeader>
                <NotificationCenterTabs defaultValue='new'>
                  <NotificationCenterTabsList>
                    <TabsTrigger value='new'>
                      New <NumericBadge size='small'>{unread.length}</NumericBadge>
                    </TabsTrigger>
                    <TabsTrigger value='read'>Read</TabsTrigger>
                  </NotificationCenterTabsList>
                  <TabsContent value='new'>
                    <NotificationCenterBody>
                      <NotificationCenterList>
                        {unread.map(item => (
                          <NotificationCenterItem key={item.id} unread>
                            <NotificationCenterItemTitle onClick={onOpenNotification}>
                              {item.title}
                            </NotificationCenterItemTitle>
                            <NotificationCenterItemTime value={item.createdAt} />
                            <NotificationCenterItemDescription>
                              {item.description}
                            </NotificationCenterItemDescription>
                          </NotificationCenterItem>
                        ))}
                      </NotificationCenterList>
                    </NotificationCenterBody>
                  </TabsContent>
                  <TabsContent value='read'>
                    <NotificationCenterBody>
                      <NotificationCenterList>
                        {read.map(item => (
                          <NotificationCenterItem key={item.id}>
                            <NotificationCenterItemTitle onClick={onOpenNotification}>
                              {item.title}
                            </NotificationCenterItemTitle>
                            <NotificationCenterItemTime value={item.createdAt} />
                            <NotificationCenterItemDescription>
                              {item.description}
                            </NotificationCenterItemDescription>
                          </NotificationCenterItem>
                        ))}
                      </NotificationCenterList>
                    </NotificationCenterBody>
                  </TabsContent>
                </NotificationCenterTabs>
              </NotificationCenterContent>
            </NotificationCenter>
            <Button variant='ghost' color='neutral' size='small' aria-label='Help'>
              <CircleHelp />
            </Button>
          </TopHeaderActions>
        </TopHeader>
      </AppShellHeader>

      <AppShellRail>
        <NavRail mode={railMode} data-testid='nav-rail'>
          <NavRailBody>
            <NavRailItem
              href='/'
              icon={HomeIcon}
              label='Home'
              shortcut={['G', 'H']}
              active
              onClick={handleRailClick}
              data-testid='nav-rail-home'
            />
            <NavRailItem href='/recent' icon={History} label='Recent' onClick={handleRailClick} />
            <NavRailSeparator />
            {PRODUCTS.map(product => (
              <NavRailItem
                key={product.id}
                href={`/${product.id}`}
                icon={product.icon}
                label={product.label}
                shortcut={product.shortcut}
                onClick={handleRailClick}
                data-testid={`nav-rail-${product.id}`}
              />
            ))}
          </NavRailBody>
          <NavRailFooter>
            <NavRailItem
              href='/settings'
              icon={Settings}
              label='Settings'
              shortcut={['G', 'S']}
              onClick={handleRailClick}
              data-testid='nav-rail-settings'
            />
            <DropdownMenu
              data-testid='account-menu'
              positioning={{ placement: 'right-end', gutter: 6, offset: { crossAxis: 12 } }}
            >
              <DropdownMenuTrigger>
                <NavRailItem
                  icon={UserRound}
                  label='Maria Lopez'
                  avatar
                  data-testid='nav-rail-account'
                />
              </DropdownMenuTrigger>
              <DropdownMenuContent className='w-200'>
                <DropdownMenuItem onSelect={onOpenProfile}>
                  <DropdownMenuItemIcon>
                    <Settings />
                  </DropdownMenuItemIcon>
                  <DropdownMenuItemText>Profile settings</DropdownMenuItemText>
                </DropdownMenuItem>
                <DropdownMenu>
                  <DropdownMenuTriggerItem>
                    <DropdownMenuItemIcon>
                      <Paintbrush />
                    </DropdownMenuItemIcon>
                    <DropdownMenuItemText>Appearance</DropdownMenuItemText>
                  </DropdownMenuTriggerItem>
                  <DropdownMenuContent>
                    <DropdownMenuRadioGroup value={theme} onValueChange={handleThemeChange}>
                      {THEMES.map(option => (
                        <DropdownMenuRadioItem key={option} value={option}>
                          <DropdownMenuItemText>{THEME_LABELS[option]}</DropdownMenuItemText>
                        </DropdownMenuRadioItem>
                      ))}
                    </DropdownMenuRadioGroup>
                  </DropdownMenuContent>
                </DropdownMenu>
                <DropdownMenu>
                  <DropdownMenuTriggerItem>
                    <DropdownMenuItemIcon>
                      <PanelLeftDashed />
                    </DropdownMenuItemIcon>
                    <DropdownMenuItemText>Sidebar mode</DropdownMenuItemText>
                  </DropdownMenuTriggerItem>
                  <DropdownMenuContent>
                    <DropdownMenuRadioGroup value={railMode} onValueChange={handleRailModeChange}>
                      {RAIL_MODES.map(option => (
                        <DropdownMenuRadioItem key={option} value={option}>
                          <DropdownMenuItemText>{RAIL_MODE_LABELS[option]}</DropdownMenuItemText>
                        </DropdownMenuRadioItem>
                      ))}
                    </DropdownMenuRadioGroup>
                  </DropdownMenuContent>
                </DropdownMenu>
                <DropdownMenuSeparator />
                <DropdownMenuItem onSelect={onSignOut}>
                  <DropdownMenuItemIcon>
                    <LogOut />
                  </DropdownMenuItemIcon>
                  <DropdownMenuItemText>Sign out</DropdownMenuItemText>
                </DropdownMenuItem>
              </DropdownMenuContent>
            </DropdownMenu>
          </NavRailFooter>
        </NavRail>
      </AppShellRail>

      <AppShellRemote role='main'>
        <Page name='home' data-testid='home-page'>
          <PageHeader>
            <PageTitle>Good morning, Maria</PageTitle>
          </PageHeader>
          <PageContent>
            <Text size='sm' color='secondary'>
              3 new incidents and 1 node update since your last visit.
            </Text>
          </PageContent>
        </Page>
      </AppShellRemote>
    </AppShell>
  );
};
```

The user menu, open from the rail's avatar item.

The user menu open from the avatar item at the foot of `NavRailFooter`: profile settings,
appearance, sidebar mode and sign out.

```tsx
import { type MouseEvent, useState } from 'react';
import { AppShell, AppShellHeader, AppShellRail, AppShellRemote } from '@wallarm-org/design-system/AppShell';
import { Button } from '@wallarm-org/design-system/Button';
import { ChatTrigger } from '@wallarm-org/design-system/Chat';
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuItemIcon, DropdownMenuItemText, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuTrigger, DropdownMenuTriggerItem } from '@wallarm-org/design-system/DropdownMenu';
import { ChevronUpDown, CircleHelp, History, Home as HomeIcon, LogOut, Paintbrush, PanelLeftDashed, Search, Settings, UserRound } from '@wallarm-org/design-system/icons';
import { Logo } from '@wallarm-org/design-system/Logo';
import { NavRail, NavRailBody, NavRailFooter, NavRailItem, type NavRailMode, NavRailSeparator } from '@wallarm-org/design-system/NavRail';
import { NotificationCenter, NotificationCenterBody, NotificationCenterContent, NotificationCenterHeader, NotificationCenterHeaderAction, NotificationCenterHeaderActions, NotificationCenterItem, NotificationCenterItemDescription, NotificationCenterItemTime, NotificationCenterItemTitle, NotificationCenterList, NotificationCenterTabs, NotificationCenterTabsList, NotificationCenterTitle, NotificationCenterTrigger } from '@wallarm-org/design-system/NotificationCenter';
import { NumericBadge } from '@wallarm-org/design-system/NumericBadge';
import { Page, PageContent, PageHeader, PageTitle } from '@wallarm-org/design-system/Page';
import { TabsContent, TabsTrigger } from '@wallarm-org/design-system/Tabs';
import { Text } from '@wallarm-org/design-system/Text';
import { useTheme } from '@wallarm-org/design-system/ThemeProvider';
import { TopHeader, TopHeaderActions, TopHeaderLogo, TopHeaderSeparator } from '@wallarm-org/design-system/TopHeader';

export const AccountMenuOpen = () => {
  const [railMode, setRailMode] = useState<NavRailMode>('expanded');
  const [accountMenuOpen, setAccountMenuOpen] = useState(true);
  const { theme, setTheme } = useTheme();
  const unread = NOTIFICATIONS.filter(item => item.unread);
  const read = NOTIFICATIONS.filter(item => !item.unread);
  const handleRailClick = (event: MouseEvent<HTMLAnchorElement>) => {
    event.preventDefault();
    onRailNavigate(event.currentTarget.getAttribute('href'));
  };
  const handleRailModeChange = ({ value }: { value: string }) => {
    const next = RAIL_MODES.find(mode => mode === value);
    if (next) setRailMode(next);
  };
  const handleThemeChange = ({ value }: { value: string }) => {
    const next = THEMES.find(option => option === value);
    if (next) setTheme(next);
  };

  return (
    <AppShell data-testid='app-shell'>
      <AppShellHeader>
        <TopHeader data-testid='top-header'>
          <TopHeaderLogo href='/' onClick={handleRailClick}>
            <Logo size='md' />
          </TopHeaderLogo>
          <TopHeaderActions>
            <Button variant='ghost' color='neutral' size='small' aria-label='Search'>
              <Search />
            </Button>
            <TopHeaderSeparator />
            <Button variant='ghost' color='neutral' size='small'>
              Acme Bank
              <ChevronUpDown />
            </Button>
            <ChatTrigger onClick={onOpenAssistant} />
            <NotificationCenter data-testid='notifications'>
              <NotificationCenterTrigger count={unread.length} />
              <NotificationCenterContent>
                <NotificationCenterHeader>
                  <NotificationCenterTitle />
                  <NotificationCenterHeaderActions>
                    <NotificationCenterHeaderAction onClick={onMarkAllRead}>
                      Mark all as read
                    </NotificationCenterHeaderAction>
                    <NotificationCenterHeaderAction asChild aria-label='Notification settings'>
                      <a href='/settings/notifications' onClick={handleRailClick}>
                        <Settings />
                      </a>
                    </NotificationCenterHeaderAction>
                  </NotificationCenterHeaderActions>
                </NotificationCenterHeader>
                <NotificationCenterTabs defaultValue='new'>
                  <NotificationCenterTabsList>
                    <TabsTrigger value='new'>
                      New <NumericBadge size='small'>{unread.length}</NumericBadge>
                    </TabsTrigger>
                    <TabsTrigger value='read'>Read</TabsTrigger>
                  </NotificationCenterTabsList>
                  <TabsContent value='new'>
                    <NotificationCenterBody>
                      <NotificationCenterList>
                        {unread.map(item => (
                          <NotificationCenterItem key={item.id} unread>
                            <NotificationCenterItemTitle onClick={onOpenNotification}>
                              {item.title}
                            </NotificationCenterItemTitle>
                            <NotificationCenterItemTime value={item.createdAt} />
                            <NotificationCenterItemDescription>
                              {item.description}
                            </NotificationCenterItemDescription>
                          </NotificationCenterItem>
                        ))}
                      </NotificationCenterList>
                    </NotificationCenterBody>
                  </TabsContent>
                  <TabsContent value='read'>
                    <NotificationCenterBody>
                      <NotificationCenterList>
                        {read.map(item => (
                          <NotificationCenterItem key={item.id}>
                            <NotificationCenterItemTitle onClick={onOpenNotification}>
                              {item.title}
                            </NotificationCenterItemTitle>
                            <NotificationCenterItemTime value={item.createdAt} />
                            <NotificationCenterItemDescription>
                              {item.description}
                            </NotificationCenterItemDescription>
                          </NotificationCenterItem>
                        ))}
                      </NotificationCenterList>
                    </NotificationCenterBody>
                  </TabsContent>
                </NotificationCenterTabs>
              </NotificationCenterContent>
            </NotificationCenter>
            <Button variant='ghost' color='neutral' size='small' aria-label='Help'>
              <CircleHelp />
            </Button>
          </TopHeaderActions>
        </TopHeader>
      </AppShellHeader>

      <AppShellRail>
        <NavRail mode={railMode} data-testid='nav-rail'>
          <NavRailBody>
            <NavRailItem
              href='/'
              icon={HomeIcon}
              label='Home'
              shortcut={['G', 'H']}
              active
              onClick={handleRailClick}
              data-testid='nav-rail-home'
            />
            <NavRailItem href='/recent' icon={History} label='Recent' onClick={handleRailClick} />
            <NavRailSeparator />
            {PRODUCTS.map(product => (
              <NavRailItem
                key={product.id}
                href={`/${product.id}`}
                icon={product.icon}
                label={product.label}
                shortcut={product.shortcut}
                onClick={handleRailClick}
                data-testid={`nav-rail-${product.id}`}
              />
            ))}
          </NavRailBody>
          <NavRailFooter>
            <NavRailItem
              href='/settings'
              icon={Settings}
              label='Settings'
              shortcut={['G', 'S']}
              onClick={handleRailClick}
              data-testid='nav-rail-settings'
            />
            <DropdownMenu
              data-testid='account-menu'
              positioning={{ placement: 'right-end', gutter: 6, offset: { crossAxis: 12 } }}
              open={accountMenuOpen}
              onOpenChange={setAccountMenuOpen}
            >
              <DropdownMenuTrigger>
                <NavRailItem
                  icon={UserRound}
                  label='Maria Lopez'
                  avatar
                  data-testid='nav-rail-account'
                />
              </DropdownMenuTrigger>
              <DropdownMenuContent className='w-200'>
                <DropdownMenuItem onSelect={onOpenProfile}>
                  <DropdownMenuItemIcon>
                    <Settings />
                  </DropdownMenuItemIcon>
                  <DropdownMenuItemText>Profile settings</DropdownMenuItemText>
                </DropdownMenuItem>
                <DropdownMenu>
                  <DropdownMenuTriggerItem>
                    <DropdownMenuItemIcon>
                      <Paintbrush />
                    </DropdownMenuItemIcon>
                    <DropdownMenuItemText>Appearance</DropdownMenuItemText>
                  </DropdownMenuTriggerItem>
                  <DropdownMenuContent>
                    <DropdownMenuRadioGroup value={theme} onValueChange={handleThemeChange}>
                      {THEMES.map(option => (
                        <DropdownMenuRadioItem key={option} value={option}>
                          <DropdownMenuItemText>{THEME_LABELS[option]}</DropdownMenuItemText>
                        </DropdownMenuRadioItem>
                      ))}
                    </DropdownMenuRadioGroup>
                  </DropdownMenuContent>
                </DropdownMenu>
                <DropdownMenu>
                  <DropdownMenuTriggerItem>
                    <DropdownMenuItemIcon>
                      <PanelLeftDashed />
                    </DropdownMenuItemIcon>
                    <DropdownMenuItemText>Sidebar mode</DropdownMenuItemText>
                  </DropdownMenuTriggerItem>
                  <DropdownMenuContent>
                    <DropdownMenuRadioGroup value={railMode} onValueChange={handleRailModeChange}>
                      {RAIL_MODES.map(option => (
                        <DropdownMenuRadioItem key={option} value={option}>
                          <DropdownMenuItemText>{RAIL_MODE_LABELS[option]}</DropdownMenuItemText>
                        </DropdownMenuRadioItem>
                      ))}
                    </DropdownMenuRadioGroup>
                  </DropdownMenuContent>
                </DropdownMenu>
                <DropdownMenuSeparator />
                <DropdownMenuItem onSelect={onSignOut}>
                  <DropdownMenuItemIcon>
                    <LogOut />
                  </DropdownMenuItemIcon>
                  <DropdownMenuItemText>Sign out</DropdownMenuItemText>
                </DropdownMenuItem>
              </DropdownMenuContent>
            </DropdownMenu>
          </NavRailFooter>
        </NavRail>
      </AppShellRail>

      <AppShellRemote role='main'>
        <Page name='home' data-testid='home-page'>
          <PageHeader>
            <PageTitle>Good morning, Maria</PageTitle>
          </PageHeader>
          <PageContent>
            <Text size='sm' color='secondary'>
              3 new incidents and 1 node update since your last visit.
            </Text>
          </PageContent>
        </Page>
      </AppShellRemote>
    </AppShell>
  );
};
```

A product inside a host group: the host's group shell around the product's page.

A product inside a host group. The host renders one group `RemoteShell` with a link per child
product; the child renders its page only, with no shell of its own.

```tsx
import { type MouseEvent, useState } from 'react';
import { AppShell, AppShellHeader, AppShellRail, AppShellRemote } from '@wallarm-org/design-system/AppShell';
import { Button } from '@wallarm-org/design-system/Button';
import { ChevronUpDown, CircleHelp, History, Home as HomeIcon, Settings } from '@wallarm-org/design-system/icons';
import { Logo } from '@wallarm-org/design-system/Logo';
import { NavRail, NavRailBody, NavRailFooter, NavRailItem, NavRailSeparator } from '@wallarm-org/design-system/NavRail';
import { Page, PageContent, PageHeader, PageTitle } from '@wallarm-org/design-system/Page';
import { RemoteShell, RemoteShellBreadcrumb, RemoteShellContent, RemoteShellPanel } from '@wallarm-org/design-system/RemoteShell';
import { type TableColumnDef, Table } from '@wallarm-org/design-system/Table';
import { TopHeader, TopHeaderActions, TopHeaderLogo } from '@wallarm-org/design-system/TopHeader';

export const GroupedProduct = () => {
  const [pathname, setPathname] = useState('/security-testing/threat-replay');

  const handleRailClick = (event: MouseEvent<HTMLAnchorElement>) => {
    event.preventDefault();
    onRailNavigate(event.currentTarget.getAttribute('href'));
  };
  const handleNavigate = (to: string) => {
    onNavigate(to);
    setPathname(to);
  };

  const columns: TableColumnDef<ReplayRun>[] = [
    { accessorKey: 'target', header: 'Target', size: 240 },
    { accessorKey: 'attacks', header: 'Replayed attacks', size: 180 },
    { accessorKey: 'status', header: 'Status', size: 160 },
  ];

  return (
    <AppShell data-testid='app-shell'>
      <AppShellHeader>
        <TopHeader data-testid='top-header'>
          <TopHeaderLogo href='/' onClick={handleRailClick}>
            <Logo size='md' />
          </TopHeaderLogo>
          <TopHeaderActions>
            <Button variant='ghost' color='neutral' size='small'>
              Acme Bank
              <ChevronUpDown />
            </Button>
            <Button variant='ghost' color='neutral' size='small' aria-label='Help'>
              <CircleHelp />
            </Button>
          </TopHeaderActions>
        </TopHeader>
      </AppShellHeader>

      <AppShellRail>
        <NavRail mode='collapsed' data-testid='nav-rail'>
          <NavRailBody>
            <NavRailItem
              href='/'
              icon={HomeIcon}
              label='Home'
              shortcut={['G', 'H']}
              onClick={handleRailClick}
              data-testid='nav-rail-home'
            />
            <NavRailItem href='/recent' icon={History} label='Recent' onClick={handleRailClick} />
            <NavRailSeparator />
            {PRODUCTS.map(product => (
              <NavRailItem
                key={product.id}
                href={`/${product.id}`}
                icon={product.icon}
                label={product.label}
                shortcut={product.shortcut}
                active={product.id === 'security-testing'}
                onClick={handleRailClick}
                data-testid={`nav-rail-${product.id}`}
              />
            ))}
          </NavRailBody>
          <NavRailFooter>
            <NavRailItem
              href='/settings'
              icon={Settings}
              label='Settings'
              shortcut={['G', 'S']}
              onClick={handleRailClick}
              data-testid='nav-rail-settings'
            />
          </NavRailFooter>
        </NavRail>
      </AppShellRail>

      <AppShellRemote role='main'>
        <RemoteShell
          config={SECURITY_TESTING_GROUP}
          basePath='/security-testing'
          pathname={pathname}
          onNavigate={handleNavigate}
          data-testid='group-shell'
        >
          <RemoteShellPanel resizable />
          <RemoteShellBreadcrumb />
          <RemoteShellContent>
            <Page name='threat-replay' fullSize fixedHeight data-testid='replay-page'>
              <PageHeader>
                <PageTitle>Threat Replay</PageTitle>
              </PageHeader>
              <PageContent>
                <Table
                  aria-label='Replay runs'
                  data={REPLAY_RUNS}
                  columns={columns}
                  data-testid='replay-table'
                />
              </PageContent>
            </Page>
          </RemoteShellContent>
        </RemoteShell>
      </AppShellRemote>
    </AppShell>
  );
};
```

Settings: a host route rendering `RemoteShell`, with no breadcrumbs in `PageHeader`.

Settings is a host route that renders `RemoteShell` itself. The trail comes from
`RemoteShellBreadcrumb`, so `PageHeader` holds no `Breadcrumbs`.

```tsx
import { type MouseEvent, useState } from 'react';
import { AppShell, AppShellHeader, AppShellRail, AppShellRemote } from '@wallarm-org/design-system/AppShell';
import { Button } from '@wallarm-org/design-system/Button';
import { ChevronUpDown, CircleHelp, History, Home as HomeIcon, Settings, Users } from '@wallarm-org/design-system/icons';
import { Logo } from '@wallarm-org/design-system/Logo';
import { NavRail, NavRailBody, NavRailFooter, NavRailItem, NavRailSeparator } from '@wallarm-org/design-system/NavRail';
import { Page, PageActions, PageContent, PageDescription, PageHeader, PageHeaderGroup, PageTitle } from '@wallarm-org/design-system/Page';
import { RemoteShell, RemoteShellBreadcrumb, RemoteShellContent, RemoteShellPanel } from '@wallarm-org/design-system/RemoteShell';
import { type TableColumnDef, Table } from '@wallarm-org/design-system/Table';
import { TopHeader, TopHeaderActions, TopHeaderLogo } from '@wallarm-org/design-system/TopHeader';

export const SettingsSection = () => {
  const [pathname, setPathname] = useState('/settings/users');

  const handleRailClick = (event: MouseEvent<HTMLAnchorElement>) => {
    event.preventDefault();
    onRailNavigate(event.currentTarget.getAttribute('href'));
  };
  const handleNavigate = (to: string) => {
    onNavigate(to);
    setPathname(to);
  };

  const columns: TableColumnDef<Member>[] = [
    { accessorKey: 'name', header: 'Name', size: 200 },
    { accessorKey: 'email', header: 'Email', size: 280 },
    { accessorKey: 'role', header: 'Role', size: 160 },
  ];

  return (
    <AppShell data-testid='app-shell'>
      <AppShellHeader>
        <TopHeader data-testid='top-header'>
          <TopHeaderLogo href='/' onClick={handleRailClick}>
            <Logo size='md' />
          </TopHeaderLogo>
          <TopHeaderActions>
            <Button variant='ghost' color='neutral' size='small'>
              Acme Bank
              <ChevronUpDown />
            </Button>
            <Button variant='ghost' color='neutral' size='small' aria-label='Help'>
              <CircleHelp />
            </Button>
          </TopHeaderActions>
        </TopHeader>
      </AppShellHeader>

      <AppShellRail>
        <NavRail mode='collapsed' data-testid='nav-rail'>
          <NavRailBody>
            <NavRailItem
              href='/'
              icon={HomeIcon}
              label='Home'
              shortcut={['G', 'H']}
              onClick={handleRailClick}
              data-testid='nav-rail-home'
            />
            <NavRailItem href='/recent' icon={History} label='Recent' onClick={handleRailClick} />
            <NavRailSeparator />
            {PRODUCTS.map(product => (
              <NavRailItem
                key={product.id}
                href={`/${product.id}`}
                icon={product.icon}
                label={product.label}
                shortcut={product.shortcut}
                onClick={handleRailClick}
                data-testid={`nav-rail-${product.id}`}
              />
            ))}
          </NavRailBody>
          <NavRailFooter>
            <NavRailItem
              href='/settings'
              icon={Settings}
              label='Settings'
              shortcut={['G', 'S']}
              active
              onClick={handleRailClick}
              data-testid='nav-rail-settings'
            />
          </NavRailFooter>
        </NavRail>
      </AppShellRail>

      <AppShellRemote role='main'>
        <RemoteShell
          config={SETTINGS_NAV}
          basePath='/settings'
          pathname={pathname}
          onNavigate={handleNavigate}
          data-testid='settings-shell'
        >
          <RemoteShellPanel />
          <RemoteShellBreadcrumb />
          <RemoteShellContent>
            <Page name='settings-users' fullSize fixedHeight data-testid='users-page'>
              <PageHeader>
                <PageHeaderGroup className='flex-1'>
                  <PageTitle>Users</PageTitle>
                  <PageDescription>
                    People who can sign in to your organization, with access set by roles.
                  </PageDescription>
                </PageHeaderGroup>
                <PageActions>
                  <Button size='medium' onClick={onCreateUser}>
                    Create user
                  </Button>
                </PageActions>
              </PageHeader>
              <PageContent>
                <Table
                  aria-label='Users'
                  data={MEMBERS}
                  columns={columns}
                  data-testid='users-table'
                />
              </PageContent>
            </Page>
          </RemoteShellContent>
        </RemoteShell>
      </AppShellRemote>
    </AppShell>
  );
};
```

A `drill` node: the entity level, the back button and the scope switcher.

A `drill` node at `/edge/data-planes/production/services`: the panel shows the entity level
with a back button, and the trail gets a scope switcher for the entity.

```tsx
import { type MouseEvent, useState } from 'react';
import { AppShell, AppShellHeader, AppShellRail, AppShellRemote } from '@wallarm-org/design-system/AppShell';
import { Button } from '@wallarm-org/design-system/Button';
import { ChevronUpDown, CircleHelp, History, Home as HomeIcon, Settings } from '@wallarm-org/design-system/icons';
import { Logo } from '@wallarm-org/design-system/Logo';
import { NavRail, NavRailBody, NavRailFooter, NavRailItem, NavRailSeparator } from '@wallarm-org/design-system/NavRail';
import { Page, PageContent, PageHeader, PageTitle } from '@wallarm-org/design-system/Page';
import { RemoteShell, RemoteShellBreadcrumb, RemoteShellContent, RemoteShellPanel } from '@wallarm-org/design-system/RemoteShell';
import { type TableColumnDef, Table } from '@wallarm-org/design-system/Table';
import { TopHeader, TopHeaderActions, TopHeaderLogo } from '@wallarm-org/design-system/TopHeader';

export const DrillDown = () => {
  const [pathname, setPathname] = useState('/edge/data-planes/production/services');

  const handleRailClick = (event: MouseEvent<HTMLAnchorElement>) => {
    event.preventDefault();
    onRailNavigate(event.currentTarget.getAttribute('href'));
  };
  const handleNavigate = (to: string) => {
    onNavigate(to);
    setPathname(to);
  };

  const columns: TableColumnDef<Service>[] = [
    { accessorKey: 'name', header: 'Service', size: 200 },
    { accessorKey: 'nodes', header: 'Nodes', size: 120 },
    { accessorKey: 'upstream', header: 'Upstream', size: 280 },
  ];

  return (
    <AppShell data-testid='app-shell'>
      <AppShellHeader>
        <TopHeader data-testid='top-header'>
          <TopHeaderLogo href='/' onClick={handleRailClick}>
            <Logo size='md' />
          </TopHeaderLogo>
          <TopHeaderActions>
            <Button variant='ghost' color='neutral' size='small'>
              Acme Bank
              <ChevronUpDown />
            </Button>
            <Button variant='ghost' color='neutral' size='small' aria-label='Help'>
              <CircleHelp />
            </Button>
          </TopHeaderActions>
        </TopHeader>
      </AppShellHeader>

      <AppShellRail>
        <NavRail mode='collapsed' data-testid='nav-rail'>
          <NavRailBody>
            <NavRailItem
              href='/'
              icon={HomeIcon}
              label='Home'
              shortcut={['G', 'H']}
              onClick={handleRailClick}
              data-testid='nav-rail-home'
            />
            <NavRailItem href='/recent' icon={History} label='Recent' onClick={handleRailClick} />
            <NavRailSeparator />
            {PRODUCTS.map(product => (
              <NavRailItem
                key={product.id}
                href={`/${product.id}`}
                icon={product.icon}
                label={product.label}
                shortcut={product.shortcut}
                active={product.id === 'edge'}
                onClick={handleRailClick}
                data-testid={`nav-rail-${product.id}`}
              />
            ))}
          </NavRailBody>
          <NavRailFooter>
            <NavRailItem
              href='/settings'
              icon={Settings}
              label='Settings'
              shortcut={['G', 'S']}
              onClick={handleRailClick}
              data-testid='nav-rail-settings'
            />
          </NavRailFooter>
        </NavRail>
      </AppShellRail>

      <AppShellRemote role='main'>
        <RemoteShell
          config={EDGE_NAV}
          basePath='/edge'
          pathname={pathname}
          onNavigate={handleNavigate}
          data-testid='product-shell'
        >
          <RemoteShellPanel resizable />
          <RemoteShellBreadcrumb />
          <RemoteShellContent>
            <Page name='edge-services' fullSize fixedHeight data-testid='services-page'>
              <PageHeader>
                <PageTitle>Services</PageTitle>
              </PageHeader>
              <PageContent>
                <Table
                  aria-label='Services'
                  data={SERVICES}
                  columns={columns}
                  data-testid='services-table'
                />
              </PageContent>
            </Page>
          </RemoteShellContent>
        </RemoteShell>
      </AppShellRemote>
    </AppShell>
  );
};
```

Loading: rail and header skeletons, product panel rows and a content loader.

While the host loads the user and the product list, skeletons sit where the header actions
and rail items land. While a product loads, its panel shows skeleton rows under the product
name and its content shows a loader.

```tsx
import { AppShell, AppShellHeader, AppShellRail, AppShellRemote } from '@wallarm-org/design-system/AppShell';
import { Home as HomeIcon } from '@wallarm-org/design-system/icons';
import { Logo } from '@wallarm-org/design-system/Logo';
import { NavRail, NavRailBody, NavRailItem, NavRailSeparator, NavRailSkeleton } from '@wallarm-org/design-system/NavRail';
import { RemoteShell, RemoteShellContent, RemoteShellPanel } from '@wallarm-org/design-system/RemoteShell';
import { Skeleton } from '@wallarm-org/design-system/Skeleton';
import { TopHeader, TopHeaderActions, TopHeaderLogo, TopHeaderSeparator } from '@wallarm-org/design-system/TopHeader';

export const Loading = () => (
  <AppShell data-testid='app-shell'>
    <AppShellHeader>
      <TopHeader data-testid='top-header'>
        <TopHeaderLogo href='/'>
          <Logo size='md' />
        </TopHeaderLogo>
        <TopHeaderActions>
          <Skeleton width='120px' height='20px' rounded={6} />
          <TopHeaderSeparator />
          <Skeleton width='60px' height='20px' rounded={6} />
        </TopHeaderActions>
      </TopHeader>
    </AppShellHeader>

    <AppShellRail>
      <NavRail mode='collapsed' data-testid='nav-rail'>
        <NavRailBody>
          <NavRailItem href='/' icon={HomeIcon} label='Home' shortcut={['G', 'H']} />
          <NavRailSeparator />
          <NavRailSkeleton />
        </NavRailBody>
      </NavRail>
    </AppShellRail>

    <AppShellRemote role='main'>
      <RemoteShell
        config={EDGE_NAV}
        basePath='/edge'
        pathname='/edge'
        onNavigate={onNavigate}
        data-testid='product-shell'
      >
        <RemoteShellPanel isLoading />
        <RemoteShellContent isLoading />
      </RemoteShell>
    </AppShellRemote>
  </AppShell>
);
```

## States

| State                                               | Show                                                           | Example component                                            |
| --------------------------------------------------- | -------------------------------------------------------------- | ------------------------------------------------------------ |
| Cold start                                          | Splash, then the shell                                         | `SplashScreen`, `AppShell reveal`                            |
| Host data loading                                   | Skeletons where header actions and rail items land             | `Skeleton`, `NavRailSkeleton`                                |
| Product bundle loading                              | Splash in `AppShellRemote`                                     | `SplashScreen`                                               |
| Product data loading                                | Product name and skeleton rows in the panel; loader in content | `RemoteShellPanel isLoading`, `RemoteShellContent isLoading` |
| Page data loading                                   | Real `PageHeader`, skeletons in content                        | `Table isLoading`                                            |
| Page or request failed                              | Shell stays; your message in `PageContent`                     | App-rendered                                                 |
| Product bundle failed                               | Shell stays; your message in `AppShellRemote`                  | App-rendered                                                 |
| Unknown URL, server down, offline, no tenant access | Replace the whole shell                                        | `UtilityPage`                                                |
| No access to one product or page                    | Leave it out of the rail or `NavConfig`                        | `NavConfig`                                                  |

## What your app owns

| Concern                  | Rule                                                                                             |
| ------------------------ | ------------------------------------------------------------------------------------------------ |
| Router wiring            | `pathname` from the router, `onNavigate={to => navigate({ to })}`                                |
| Rail mode                | Store the user's preference; "adaptive" (expanded on Home, collapsed in a product) is your logic |
| Product list             | From the microfrontends API; rail items with `href`, `label`, `icon` and a `shortcut` chord      |
| Recent and account menus | Your `DropdownMenu` compositions                                                                 |
| Notifications            | Data, unread count, mark-read logic, the preferences page                                        |
| Permissions              | Leave forbidden products and entries out of the rail and `NavConfig`                             |
| Errors                   | An error boundary in `AppShellRemote` and in the product's content                               |
| Prefetch on hover        | `onPointerOver` and `onFocus` on `RemoteShellPanel`                                              |
| Panel width              | `resizable` keeps it in memory only; it resets on remount                                        |
| Drill labels             | `entities` are static; pass fresh ones in `NavConfig` when data changes                          |
| Test IDs                 | Panel items and crumbs have none; use roles inside `{shell}--panel` and `{shell}--breadcrumb`    |

## Related

- [Spacing](https://wallarm.github.io/design-system/foundations/spacing.md)
- [Layering](https://wallarm.github.io/design-system/foundations/layering.md)
- [Resource list page](https://wallarm.github.io/design-system/patterns/resource-list-page.md)
- [Settings page](https://wallarm.github.io/design-system/patterns/settings-page.md)
- [Empty states](https://wallarm.github.io/design-system/patterns/empty-states.md)
- [Auth page](https://wallarm.github.io/design-system/patterns/auth-page.md)
