Skip to content
THE COMPONENT LIBRARY
Skip to content

Component reference

DashboardLayout

A composed workspace with sidebar, navbar, content and an optional right rail.

Preview

Live preview

Changes apply to this preview only.

Width adapts to the available space

More examples

Different configurations and compositions using the real Pimolu API. Each preview runs independently and follows the site appearance.

Sidebar and navbar

The sidebar stays visible while the main content scrolls. The right rail is optional and shown in the next example.

Open preview

With a right rail

At narrow widths, the sidebar collapses and stacks above the content. The right rail remains available below the main region.

Open preview

Main content only

Both sidebar and aside are optional; the layout collapses to a single main region and the navbar can still be sticky.

Open preview

Usage

Provide Sidebar and Navbar through their slots. Widths accept CSS lengths or pixel numbers. The sidebar controls its own collapse state; the layout arranges the regions.

Choose DashboardLayout for this opinionated dashboard composition. AppShell is the more general application structure. The preview uses its own document so its main landmark does not nest inside the documentation's main.

API reference

Generated from the public TypeScript declarations. Native HTML attributes are inherited where the component extends them; this reference includes Pimolu props and selected common native attributes.

PimoluDashboardLayoutProps

Type source
PimoluDashboardLayoutProps public API
NameTypeDefaultDescription
sidebarReactNode—Persistent navigation, usually a Sidebar.
navbarReactNode—Top bar, usually a Navbar.
childrenRequiredReactNode—Main dashboard content.
asideReactNode—Optional right rail.
sidebarWidthProperty.Width<string | number> | undefined16remWidth of the sidebar. Defaults to 16rem.
asideWidthProperty.Width<string | number> | undefined20remWidth of the aside. Defaults to 20rem.
stickySidebarboolean | undefinedfalseKeep the sidebar visible while the content scrolls.
stickyNavbarboolean | undefinedfalseKeep the navbar visible while the content scrolls.
asideLabelstring | undefined"Aside"Accessible name of the right rail. Defaults to "Aside".
defaultValuestring | number | readonly string[] | undefined—Standard React/HTML attribute.
classNamestring | undefined—Standard React/HTML attribute.
styleCSSProperties | undefined—Standard React/HTML attribute.
aria-labelstring | undefined—Defines a string value that labels the current element.
onChangeChangeEventHandler<HTMLDivElement, Element> | undefined—Standard React/HTML attribute.
onClickMouseEventHandler<HTMLDivElement> | undefined—Standard React/HTML attribute.
sidebar

ReactNode

No default extracted.

Persistent navigation, usually a Sidebar.

navbar

ReactNode

No default extracted.

Top bar, usually a Navbar.

childrenRequired

ReactNode

No default extracted.

Main dashboard content.

aside

ReactNode

No default extracted.

Optional right rail.

sidebarWidth

Property.Width<string | number> | undefined

Default: 16rem

Width of the sidebar. Defaults to 16rem.

asideWidth

Property.Width<string | number> | undefined

Default: 20rem

Width of the aside. Defaults to 20rem.

stickySidebar

boolean | undefined

Default: false

Keep the sidebar visible while the content scrolls.

stickyNavbar

boolean | undefined

Default: false

Keep the navbar visible while the content scrolls.

asideLabel

string | undefined

Default: "Aside"

Accessible name of the right rail. Defaults to "Aside".

defaultValue

string | number | readonly string[] | undefined

No default extracted.

Standard React/HTML attribute.

className

string | undefined

No default extracted.

Standard React/HTML attribute.

style

CSSProperties | undefined

No default extracted.

Standard React/HTML attribute.

aria-label

string | undefined

No default extracted.

Defines a string value that labels the current element.

onChange

ChangeEventHandler<HTMLDivElement, Element> | undefined

No default extracted.

Standard React/HTML attribute.

onClick

MouseEventHandler<HTMLDivElement> | undefined

No default extracted.

Standard React/HTML attribute.

Accessibility

  • Name each navigation region and the optional aside.
  • Verify the composition at narrow widths. Collapsing a sidebar and opening a mobile overlay are different interactions; choose the behavior your app needs.
Read the accessibility guide →