Dashboard

Sidebar shell with stat cards, an interactive area chart and a sortable, selectable data table.

Installation

pnpm dlx shadcn@latest add @ward/dashboard

Add the Ward registry to components.json once:

"registries": {
  "@ward": "https://ward.so/r/{name}.json"
}

Or install from the URL with no configuration: npx shadcn@latest add https://ward.so/r/dashboard.json

Usage

import Dashboard from "@/components/ward/dashboard/dashboard";
<Dashboard />

Props

PropTypeDefaultDescription
SiteHeader titlestring-Page title shown beside the sidebar toggle.
SectionCards cards{ label: string; value: string; change?: string; note?: string }[]-One card per stat. A change that starts with a minus sign shows a falling trend, any other change a rising one.
ChartArea data{ date: string; [series: string]: number | string }[]-One row per day, with an ISO date and a number for each series. The 7, 30 and 90 day ranges count back from the newest row.
ChartArea configChartConfig-A label and colour for each series key in data. The series stack in the order given.
ChartArea titlestring"Activity"Heading of the chart card.
ChartArea descriptionstring-Line under the heading. Without one, the card names the range picked, such as Last 30 days.
DataTable columnsColumnDef<T>[]-TanStack Table column definitions for your rows. The table adds the row checkbox column itself; use SortableHeader as a column's header to make it sortable.
DataTable dataT[]-The rows, shown 10 to a page.
DataTable searchKeystring-Id of the column the search box filters. Leave it out to hide the search box.

Ward · Version 1.0.0 · Registry manifest