Skip to content
Vertical Jump Designs-uiFront-End Studio
Get Pro

v3.9 is out.

Pro (paid add-on)

Dashboard

Pro

A ready-made dashboard template: the app frame with navigation and a top bar, page headers, content layouts, and widgets with loading, error and empty states. You fill it with your own data and components.

Part of Pro

The dashboard template is in @vjdesigns-pro/ui, the commercial add-on package. See pricing. It needs @vjdesigns/vjdesigns-ui 3.8.0 or later, and works in both modes, every brand, all 32 languages and right to left. Install it as described in Account forms.

The parts

The parts
PartWhat it is
DashboardShellThe app frame: navigation, a top bar with search and actions, the main content, and an optional side panel
DashboardPageA page header (breadcrumbs, title, description and actions) above the content
DashboardGridLays out widgets: a 12-column grid, auto-fit columns, or a named template
DashboardWidgetA titled card with actions, a footer, and built-in loading, error and empty states
DashboardSplitViewA list beside a detail pane, for an inbox, orders or a roster. Phones show one pane at a time

Example

You choose the frame and the content layout separately, then fill the widgets with any components: Stat, DataGrid, the Pro charts, or your own.

tsx
import {
  DashboardGrid,
  DashboardPage,
  DashboardShell,
  DashboardWidget,
  LineChart,
} from "@vjdesigns-pro/ui";
import { Button, DataGrid, Icon, SearchInput, StatGroup } from "@vjdesigns/vjdesigns-ui";

<DashboardShell
  layout="sidebar"
  variant="inset"
  brand={<YourLogo />}
  brandHref="/"
  nav={[
    {
      items: [
        { label: "Overview", href: "/", icon: <Icon name="home" />, active: true },
        { label: "Messages", href: "/messages", icon: <Icon name="mail" />, badge: 3, badgeLabel: "3 unread" },
      ],
    },
    {
      heading: "Reports",
      items: [{ label: "Season", href: "/season", icon: <Icon name="file" /> }],
    },
  ]}
  onNavigate={(item, event) => {
    event.preventDefault(); // client-side routing
    router.push(item.href!);
  }}
  search={<SearchInput aria-label="Search" />}
  actions={<UserMenu />}
>
  <DashboardPage title="Overview" actions={<Button>New game</Button>}>
    <DashboardGrid template="overview">
      <DashboardWidget area="kpis" variant="plain" aria-label="Season at a glance">
        <StatGroup variant="card" divided>…</StatGroup>
      </DashboardWidget>
      <DashboardWidget area="main" title="Scoring">
        <LineChart … />
      </DashboardWidget>
      <DashboardWidget area="side" title="Top scorers" loading={isLoading}>…</DashboardWidget>
      <DashboardWidget area="wide" title="Recent games" flush>
        <DataGrid … />
      </DashboardWidget>
    </DashboardGrid>
  </DashboardPage>
</DashboardShell>;

Frame options

  • `layout`: "sidebar" (the default) has a full-height sidebar with the top bar beside it. "header" has a full-width top bar with the sidebar below it. "topnav" has no sidebar: the links sit in the top bar, and nested links become dropdowns.
  • `variant`: "flat" (the default) puts the content on the page background. "inset" puts it in a raised, rounded panel.
  • Sidebar: sidebarSide puts it at the start or end, following the text direction. sidebarCollapsible adds a button that collapses it to an icon rail, with tooltips for the labels; its state is controllable, so you can save it. sidebarFooter holds content such as the signed-in user.
  • Side panel: aside adds a panel beside the content, for activity or details. It stacks below the content on narrow screens.
  • Small screens: below collapseBelow ("lg" by default), the sidebar becomes a drawer opened from a menu button, and the top navigation moves into a menu.
  • Top bar: search, actions, stickyHeader and skipLink (a "Skip to main content" link). The last two are on by default.

Content layouts

template on DashboardGrid picks the layout. The grid measures its own width rather than the window's, so it reflows when the sidebar collapses or the side panel opens. In the named templates, each widget takes its place by area. On narrow grids every template becomes one column in source order, so put widgets in the order they should be read.

Content layouts
templateLayout
columnsThe default. 12 columns: each widget sets span at each grid width, such as { base: 12, md: 6, lg: 3 }
autoAs many equal columns as fit, each at least minItemWidth (18rem)
overviewkpis across the top, main beside a narrower side, then secondary and wide
analyticskpis, then main and secondary side by side, then side and wide
splitmain with a narrower side column
bentokpis, then a large hero with tile1 to tile3 beside it, then wide
stackOne column. Pair it with DashboardPage maxWidth="lg" for reports and settings

Widgets

  • `title` names the widget's region for screen readers, as a level 2 heading under the page's level 1 (headingLevel changes it). description, actions and footer are optional.
  • States: loading shows a skeleton and sets aria-busy. error shows an error message, with a Retry button when you pass onRetry. empty shows a "nothing here yet" message. Pass text instead of true for your own message.
  • Look: variant takes any Card variant ("outline" by default), or "plain" for no card, such as a row of stats. flush removes the padding for edge-to-edge tables and charts.

Ready-made pages

Pro comes with six complete pages to copy and fill with your data: analytics, team roster, inbox, reports, settings and first run. Each one has interaction tests and automatic accessibility checks in light and dark mode, and the inbox is also tested at phone width.

Accessibility

The dashboard is built from the free Sidebar, Navbar, Card, EmptyState and Skeleton, so it gets their keyboard support, landmarks and translations, and adds no text of its own to translate. Nested links in the top navigation are disclosure dropdowns, not menus, so they stay ordinary links in the Tab order.