Skip to Content
OpenPerf

Components

Shell

App frame that puts a Sidebar next to the main content area and shares the drawer state between them.

import { Shell, Sidebar } from "@openperf/deft";

<Shell.Root>
  <Sidebar.Root>
    <Sidebar.Content>
      <Sidebar.Item href="/errors">Errors</Sidebar.Item>
    </Sidebar.Content>
  </Sidebar.Root>
  <Shell.Main>{children}</Shell.Main>
</Shell.Root>;

When to use

NeedComponent
Screen with a SidebarShell
Screen without navigation: sign-in, onboarding, full-page errorStandalone

Anatomy

<Shell.Root>
  <Backdrop.Root /> {/* optional */}
  <Sidebar.Root />
  <Shell.Main>
    <Shell.Bar /> {/* only on a page without a header of its own */}
    {page}
  </Shell.Main>
</Shell.Root>

Shell.Root is a row at least as tall as the viewport. It wraps its children in Sidebar.Provider, so Sidebar.Root and every Sidebar.Trigger inside share the drawer state without a provider of your own. Shell.Main takes the remaining width and lays the page out as a column.

Small screens

Shell.Bar is visible only below 900px and holds a Sidebar.Trigger, so the sidebar can still be opened on a page that has no header. It takes no children. A page with a header puts Sidebar.Trigger there instead.

Page structure

PageBuilt from
Any pageA Breadcrumb as the title.
Settings pageA stack of Section components, each with a List or a Panel.
Detail pageA stack of Block components, each with a Data table, a Table or other data.

Deft has no page container: add your own wrapper between Shell.Main and these parts to set the page width and gutters.

API

No part declares props of its own; each one passes native HTML attributes to its element. Shell.Bar accepts no children.

On this page