# App shell and sidebar layouts without breakpoints

> iVOLT shell and sidebar: an app frame with a glass top bar, a side column that becomes a drawer below lg, and a sidebar that stacks by available width.

Source: https://ivolt.intervolutions.com/components/shell · iVOLT 1.1.2 · English

Two layouts for application screens. `iv-sidebar` puts a side column next to the content and stacks the two when the content would get too narrow — decided by the room the block has, not by the width of the window, so the same markup works in a page, a card or a dialog. `iv-shell` is a whole application frame: a sticky glass bar across the top, a side column that is sticky from the `lg` breakpoint, and the main area; below `lg` the column folds away and a [drawer](https://ivolt.intervolutions.com/components/drawer) inside it becomes the menu.

**CSS:** `css/components/shell.css` (in `ivolt.css`). **JS:** only the `Drawer` of the side column (`@intervolutions/ivolt/drawer` or `auto.js`). New in 1.1.

Couldn't load the demo. [Open alone](https://ivolt.intervolutions.com/stage/shell/basic.html?id=fx-shell-basic)

```html
<div class="iv-stack iv-u-gap-6">
  <div class="iv-shell" style="min-block-size: 30rem; border: 1px solid var(--iv-color-border); border-radius: var(--iv-radius-lg); overflow: clip">
    <header class="iv-shell__top">
      <a class="iv-button iv-button--ghost iv-button--icon iv-u-lg-hidden" href="#shell-nav" data-iv-open="shell-nav" aria-label="Open navigation">
        <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true"><path d="M4 7h16M4 12h16M4 17h16"/></svg>
      </a>
      <strong>Console</strong>
      <span class="iv-badge iv-badge--primary">Sample</span>
    </header>
    <aside class="iv-shell__side" aria-label="Console navigation">
      <dialog class="iv-drawer" id="shell-nav" data-iv-component="drawer" data-iv-static-from="lg" aria-label="Console navigation">
        <div class="iv-drawer__panel">
          <div class="iv-drawer__body">
            <ul class="iv-list iv-list--flush" aria-label="Sections">
              <li class="iv-list__item"><a class="iv-list__action" href="#shell-note" aria-current="page">Overview</a></li>
              <li class="iv-list__item"><a class="iv-list__action" href="#shell-note">Deploys</a></li>
              <li class="iv-list__item"><a class="iv-list__action" href="#shell-note">Domains</a></li>
              <li class="iv-list__item"><a class="iv-list__action" href="#shell-note">Settings</a></li>
            </ul>
          </div>
        </div>
      </dialog>
    </aside>
    <main class="iv-shell__main">
      <div class="iv-sidebar iv-sidebar--end">
        <div class="iv-stack iv-u-gap-3">
          <h3 class="iv-u-m-0">Overview</h3>
          <p class="iv-u-m-0 iv-u-text-muted">The main column takes the room; the panel beside it keeps 14rem and drops under the content when the column gets narrow, without a breakpoint.</p>
        </div>
        <aside class="iv-card" style="--iv-sidebar-width: 14rem" aria-label="Status">
          <div class="iv-card__body iv-stack iv-u-gap-2">
            <strong>Status</strong>
            <span class="iv-badge iv-badge--success">All systems operational</span>
          </div>
        </aside>
      </div>
    </main>
  </div>

  <p class="iv-u-m-0 iv-u-text-sm iv-u-text-muted" id="shell-note">Demo frame: the navigation leads back to this note. From the lg breakpoint the drawer is the side column; below it, the menu button opens it as a modal.</p>
</div>
```

```css
.iv-root {
  --iv-sidebar-width: 14rem;
}
```

```js
// data-iv-component="drawer"
{
  open: "shell-nav",
  staticFrom: "lg",
}
```

## The sidebar layout

```
<div class="iv-sidebar">
  <aside>…</aside>        <!-- keeps --iv-sidebar-width -->
  <div>…</div>            <!-- takes the rest -->
</div>
```

Two children. The side keeps `--iv-sidebar-width` (16rem) and the content takes what is left; when the content would fall under `--iv-sidebar-min` of the container, both wrap and stack, with the side on top. `iv-sidebar--end` puts the side column after the content, as the status card in the example. The technique is flex wrapping with a huge grow factor on the content — no media query and no container query, which is why it nests anywhere. Use it for a filter column beside results, an aside beside an article, or a settings menu beside its form.

## The application shell

```
<div class="iv-shell">
  <header class="iv-shell__top">…menu button, product name…</header>
  <aside class="iv-shell__side" aria-label="Console navigation">
    <dialog class="iv-drawer" id="nav" data-iv-component="drawer"
            data-iv-static-from="lg" aria-label="Console navigation">…</dialog>
  </aside>
  <main class="iv-shell__main">…</main>
</div>
```

From `lg` the drawer is static: it renders in place as the side column, sticky under the bar and as tall as the viewport. Below `lg` the column takes no room, the menu button in the bar (`data-iv-open="nav"`, hidden from `lg` with `iv-u-lg-hidden`) opens the same drawer as a modal, and focus, Escape and the backdrop work as on any drawer. One navigation in the source, two presentations, no duplicated markup.

## Accessibility

- Name the landmarks: the side column is an `<aside>` with an `aria-label`, the content is the page's single `<main>`. Inside a page that already has a `<main>`, use a `<div class="iv-shell__main">` instead.
- Mark the current section with `aria-current="page"`; the [navigation list](https://ivolt.intervolutions.com/components/list) styles it.
- Without JavaScript the menu button is still a link to the drawer's id: following it shows the drawer through `:target` as a static block, so the navigation stays reachable (see [drawer](https://ivolt.intervolutions.com/components/drawer)).
- The top bar keeps a solid edge in forced colours, where its glass blur is dropped.

## Customising

```
.console {
  --iv-shell-side: 18rem;
  --iv-shell-top: 4rem;
}
.filters { --iv-sidebar-width: 14rem; --iv-sidebar-min: 55%; --iv-sidebar-gap: var(--iv-space-8); }
```

Shell locals: `--iv-shell-side` (16rem, the column width from `lg`) and `--iv-shell-top` (3.75rem, the bar height the column sticks under). Sidebar locals: `--iv-sidebar-width`, `--iv-sidebar-min` and `--iv-sidebar-gap`; set the width on the side child itself when one sidebar needs a different column, as the example does.

## Common mistakes

- Two navigations in the source, one for desktop and one for mobile: screen readers find both.
- A static drawer outside `aside` or `nav`: the drawer warns about it in development.
- Nesting an `iv-shell` inside another, or a `<main>` inside a `<main>`.
- Giving the sidebar child a fixed width with a utility instead of the local, which stops it from wrapping.

## Class index

Every class of the two families. The full list per stylesheet lives in the [reference](https://ivolt.intervolutions.com/reference).

| Class | What it does |
| --- | --- |
| `iv-sidebar` | Side column and content that stack by available width. |
| `iv-sidebar--end` | Side column after the content. |
| `iv-shell` | Application frame. |
| `iv-shell__top` | Sticky glass top bar. |
| `iv-shell__side` | Side column from `lg`; holds a static drawer. |
| `iv-shell__main` | The main area. |
