# Dashboard

> Source: https://design.nanatec.co.ke/components/dashboard-shell/
> A whole dashboard from data: a sidebar with your brand, navigation and the signed-in user, a top bar, and a page header over your content. Pick the sidebar, floating or inset layout.

The dashboard shell is the frame of an app. Give it your brand, your navigation as data
and the signed-in user, and it lays out the [sidebar](/components/sidebar/), the
[top bar](/components/top-bar/) and the [page header](/components/page-header/). Your
content goes underneath: stats, charts, tables, anything.

It installs as a block, so the code lands in your project and is yours to change.

## Preview

## Installation

`nav` and `user` are data, so set them from script. Icons are names from the icon set.

```html
<nana-dashboard-shell brand="Nana Insurance" heading="Overview">
  <nana-input slot="search" type="search" aria-label="Search"></nana-input>
  <nana-icon-button slot="toolbar" name="bell" label="Notifications"></nana-icon-button>
  <nana-button slot="actions">New claim</nana-button>
  <p>Your content</p>
</nana-dashboard-shell>

<script type="module">
  const shell = document.querySelector('nana-dashboard-shell');
  shell.nav = [
    {
      label: 'Workspace',
      items: [
        { label: 'Overview', href: '/', icon: 'home', active: true },
        { label: 'Claims', icon: 'document-text', items: [{ label: 'Motor', href: '/claims/motor' }] },
      ],
    },
  ];
  shell.user = { name: 'Amina Otieno', detail: 'Claims lead' };
</script>
```

| Place | Svelte snippet | Web component slot |
| --- | --- | --- |
| Brand mark, in place of the first letter | `mark` | `mark` |
| Top bar, after the sidebar trigger | `breadcrumb` | `breadcrumb` |
| Middle of the top bar | `search` | `search` |
| End of the top bar | `toolbar` | `toolbar` |
| Beside the page title | `actions` | `actions` |
| Sidebar footer, in place of the user card | `footer` | `footer` |
| Under the page header | children | default slot |

## Layouts

`variant` picks how the sidebar sits beside the page, and `collapsible` how it folds away,
just as on the [sidebar](/components/sidebar/#variants). Everything else stays the same,
so a layout change is one prop.

### Inset

The sidebar blends into the background and the page sits in a raised, rounded panel.

### Floating

The sidebar floats as a card in a small gutter.

### Analytics

Charts first, the numbers underneath. The charts take their colours from the theme
through the [chart](/components/chart/) container.

## Inside a fixed height

The shell fills the screen: the sidebar is as tall as the viewport and the page scrolls
with the window. To fit it in a box of its own, such as a preview, let the page scroll
inside the box instead.

`brand`, `nav` and `heading` are required. `user` fills the sidebar footer. `variant`,
`collapsible`, `open` (bindable), `storageKey` and `label` pass to the sidebar layout;
`description` and `level` to the page header. `brandHref` links the brand.
