Pro (paid add-on)
Dashboard
ProA 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
| Part | What it is |
|---|---|
DashboardShell | The app frame: navigation, a top bar with search and actions, the main content, and an optional side panel |
DashboardPage | A page header (breadcrumbs, title, description and actions) above the content |
DashboardGrid | Lays out widgets: a 12-column grid, auto-fit columns, or a named template |
DashboardWidget | A titled card with actions, a footer, and built-in loading, error and empty states |
DashboardSplitView | A 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.
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:
sidebarSideputs it at the start or end, following the text direction.sidebarCollapsibleadds a button that collapses it to an icon rail, with tooltips for the labels; its state is controllable, so you can save it.sidebarFooterholds content such as the signed-in user. - Side panel:
asideadds 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,stickyHeaderandskipLink(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.
template | Layout |
|---|---|
columns | The default. 12 columns: each widget sets span at each grid width, such as { base: 12, md: 6, lg: 3 } |
auto | As many equal columns as fit, each at least minItemWidth (18rem) |
overview | kpis across the top, main beside a narrower side, then secondary and wide |
analytics | kpis, then main and secondary side by side, then side and wide |
split | main with a narrower side column |
bento | kpis, then a large hero with tile1 to tile3 beside it, then wide |
stack | One 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 (
headingLevelchanges it).description,actionsandfooterare optional. - States:
loadingshows a skeleton and setsaria-busy.errorshows an error message, with a Retry button when you passonRetry.emptyshows a "nothing here yet" message. Pass text instead oftruefor your own message. - Look:
varianttakes any Card variant ("outline"by default), or"plain"for no card, such as a row of stats.flushremoves 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.