# Dashboard App Shell

> A full-height admin layout with a sidebar, a top bar and a main area that scrolls on its own.

- Category: [CSS Layouts](https://copy-css.com/category/layouts)
- Tags: dashboard, admin, sidebar, top bar, independent scroll, grid
- Live preview: https://copy-css.com/snippets/dashboard-app-shell
- License: Free for personal and commercial use. No signup, no attribution required.

## HTML

```html
<div class="app-shell">
  <aside class="app-shell-side">Sidebar</aside>
  <header class="app-shell-top">Top bar</header>
  <main class="app-shell-main">
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
  </main>
</div>
```

## CSS

```css
.app-shell {
  --side: 240px;
  display: grid;
  grid-template:
    "side top" auto
    "side main" 1fr
    / var(--side) 1fr;
  height: 100vh;
  height: 100dvh;
}

.app-shell-side {
  grid-area: side;
  overflow-y: auto;
}

.app-shell-top {
  grid-area: top;
}

/* Only the main area scrolls; sidebar and top bar stay put */
.app-shell-main {
  grid-area: main;
  min-height: 0;
  overflow-y: auto;
}

/* Small screens: drop the sidebar (open it from a menu button instead) */
@media (max-width: 720px) {
  .app-shell {
    grid-template:
      "top" auto
      "main" 1fr
      / 1fr;
  }

  .app-shell-side {
    display: none;
  }
}
```

## Notes

- This CSS Dashboard App Shell is 40 lines of pure CSS (0.6 KB) with no JavaScript and no dependencies. It uses CSS Grid and custom properties.
- Customize with: `--side`.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
