Skip to content

DashboardGroup

The root of a resizable, collapsible dashboard shell - sidebar, resize handle, and main content panel.

Usage

Acme Inc
JDJane Doe

Overview

Drag the divider to resize the sidebar, or use the navbar's toggle button to collapse it down to an icon rail. Shrink the browser window to see it switch to a drawer instead.

vue-html
<SDashboardGroup>
  <SDashboardSidebar>
    <template #header>Acme Inc</template>
    <nav>...</nav>
  </SDashboardSidebar>
  <SDashboardResizeHandle />
  <SDashboardPanel>
    <SDashboardNavbar title="Overview" />
    <main>...</main>
  </SDashboardPanel>
</SDashboardGroup>

SDashboardGroup coordinates the whole shell - place a DashboardSidebar, a DashboardResizeHandle, and a DashboardPanel inside it directly (not wrapped in anything else - it needs to see all three as its own children). It's a themed wrapper around Splitter - SDashboardSidebar/SDashboardPanel wrap SSplitterPanel the same way, so the resize/collapse/remember-the-width behavior all comes from that same general-purpose primitive, not logic specific to a dashboard shell.

Persistence

The sidebar's width (and whether it's collapsed) is remembered across reloads via a cookie, keyed by autoSaveId - give pages that shouldn't share one remembered layout their own distinct id. A cookie rather than Reka's own default localStorage-backed storage - same-origin server-readable, portable across a full page reload rather than just client-side navigation, and works with privacy tooling that blocks localStorage but allows first-party cookies.

The server-rendered sidebar uses its configured pixel default, keeping the main panel visible before hydration. Remembered width and collapse state apply after mounting: the splitter restores them when its panels register and the container can be measured. A returning visitor first sees the default width, then the saved layout.

Mobile

Below mobileBreakpoint (768px by default), there's no resizable panel at all - SDashboardSidebar switches to rendering its content inside a Drawer overlay instead, and SDashboardResizeHandle renders nothing (there's nothing to drag once the sidebar isn't part of a split layout). Try resizing this page's own browser window narrower than a phone to see it switch live.

Custom :ui

To see exactly what you'd be overriding - the current default classes for every slot - here's DashboardGroup's own theme file:

Theme source "dashboard-group" not found

Props

PropTypeDefault
autoSaveIdstring'selaras-dashboard'
mobileBreakpointnumber768
uiPartial<Record<'root', string | object>>-
Edit this page