Dashboard Component โ€” Astro

Layout component with sidebar and main content area for app dashboards. Uses Rizzo tokens and BEM classes.

Dashboard Component

The Dashboard component provides a two-column layout: a sidebar (for navigation) and a main content area. It uses Rizzo design tokens and BEM classes (dashboard, dashboard__sidebar, dashboard__main, dashboard__nav, dashboard__nav-link). On small screens the layout stacks vertically.

Add this component

The command below includes <strong>Dashboard</strong>โ€”run it in your project directory to install this component (and the CSS if needed). No prompts.

Choose your package manager โ€” click a tab to select, then copy the command.

npm pnpm yarn bun

Basic usage

Use the default sidebar (Dashboard, Items, Settings) or pass your own nav via the sidebar slot (Astro) or sidebar snippet (Svelte).

Live example

Dashboard

Overview. Same structure as the Dashboard block.

Key metrics

Total users 1,234
Revenue $12,345
Active 89%

Recent activity

Recent activity list
Name Status Date
Item one Done Today
Item two Pending Yesterday
Item three Failed Jan 15

Usage

Usage

Full example for each framework (Astro, Vanilla, Svelte, Vue, React). Switch framework via View as or by clicking a Usage tabโ€”both stay in sync.

Astro Vanilla Svelte Vue React

Props (Astro)

  • sidebarLabel โ€” Aria-label for the sidebar (default: "Dashboard navigation").
  • class โ€” Optional class on the root .dashboard element.

Slot sidebar: optional. If provided, replaces the default nav links. Default slot: main content.

BEM classes

  • dashboard โ€” Root flex container (column on mobile).
  • dashboard__sidebar โ€” Sidebar column.
  • dashboard__nav โ€” Nav container inside sidebar.
  • dashboard__nav-link โ€” Nav link; use dashboard__nav-link--active for current page.
  • dashboard__main โ€” Main content area.

Other frameworks: Vanilla ยท Svelte ยท Vue ยท React

Related

See the Dashboard with sidebar block for a full example with stat cards and a table.