Admin Dashboard Page React block for Tailwind CSS v4
v1.2.1Updated in 1.9.0
A React admin dashboard page: greeting and period, four KPIs, revenue against the previous period, recent orders, alerts and team activity.
Pick the period in the date range field (presets such as Last 7 days or Last month beside two months on desktop, a bottom sheet on phones): every panel fades to the new numbers, the KPI values count to theirs and the chart grows again. Each KPI tile is a link with a spoken name ("Revenue, $248,300, up 12.4%"); the (i) buttons explain revenue and conversion. Switch the revenue chart between Daily and Weekly (weekly needs 14 days or more), hover, tap or arrow through its points to read both periods, and click a legend entry to hide a series. The Needs attention rows are links with a count. In Recent orders, search by number or client, toggle the New, Shipping and Unpaid chips, sort by a header, select rows for the bulk bar (Confirm, Export, Cancel), open a row's menu (View, Confirm order, Print label, Cancel; Shift+F10 on a focused row) or click a row, or press Enter on it, to open the order sheet: its status, the delivery tracker with the carrier and tracking number, the products, the client and the payment, with Confirm order, Print label and Cancel in the footer. Confirming shows a spinner in the row's badge while it saves; cancelling asks first, then offers Undo in a toast for 5 seconds. The sheet slides in from the right (a tall bottom sheet on phones, drag the handle down to close), Escape closes it and focus returns to the row. On phones the orders are cards with Load more, the header keeps the period field, a + button and a menu with Export, and the KPIs sit two by two. Sections rise in once on mount; reduced motion keeps everything still.
Admin Dashboard Page is a Pro React block in the React blocks category, written in TypeScript for React 19 and Tailwind CSS v4. It installs as source with npx wingo-ui@latest add admin-dashboard-page, together with Alert Dialog, Area chart, Avatar, Badge, Button and 26 more and the npm packages motion and lucide-react.
Add to a project
Requirements: React 19 and Tailwind CSS v4, in Next.js (App Router or Pages), Vite or React Router. Installation guide · Next.js setup · Vite setup
npx wingo-ui@latest add admin-dashboard-pageAdmin Dashboard Page is part of Pro, with 298 more Pro items: $8 a month or $150 once. 14-day refund before you download any Pro item. See plans
Usage
Import AdminDashboardPage from @/components/blocks/admin-dashboard-page.
// app/(admin)/page.tsx (the shell lives in app/(admin)/layout.tsx: <AdminShell>{children}</AdminShell>)
"use client"
import { useRouter } from "next/navigation"
import { AdminDashboardPage } from "@/components/blocks/admin-dashboard-page"
export default function HomePage() {
const router = useRouter()
return (
<AdminDashboardPage
userName="Anna"
onCreateOrder={() => router.push("/orders/new")}
onOrderAction={async (action, order) => {
await fetch(`/api/orders/${order.id}/${action}`, { method: "POST" })
}}
/>
)
}Props
userNamedefault"Anna"stringThe name in the greeting ("Hi, Anna").
childrenReactNodeExtra sections after the built-in rows (more charts, a funnel, a table), in the page column; they rise in with the rest.
periodDateRangeThe reporting period, controlled; pair it with onPeriodChange.
defaultPeriodDateRangeThe period while uncontrolled; defaults to August 26 to September 24, 2026. A change regenerates the sample through generateDashboardData when the data props are not given.
onPeriodChange(period: DateRange) => voidCalled when a complete range is applied in the date field.
presetsDateRangePreset[]The quick ranges beside the calendar ({ key, label, value }). Defaults to Last 7 days, Last 30 days, This month, Last month, This quarter and This year, measured from now.
kpisDashboardKpi[]The four tiles ({ id, label, value, format, delta, deltaFormat, sparkline, goal, href, info, icon, tone, caption }); defaults to the sample for the period (ADMIN_DASHBOARD_SAMPLE.kpis). A null value shows a dash. Every card in the row keeps one anatomy: when any card has a sparkline the others get a flat baseline in its place, and when any has a delta the others show caption (default labels.noComparison). A zero change reads No change.
revenue{ date: string; current: number | null; previous: number | null }[]Daily revenue for the chart, ISO days; defaults to the sample for the period (ADMIN_DASHBOARD_SAMPLE.revenue).
ordersDashboardOrder[]The recent orders ({ id, number, client, date, status, payment, paid, total, items, courier, awb }); defaults to the 40 newest orders of the period (ADMIN_DASHBOARD_SAMPLE.orders).
recentReactNodeYour own content for the recent panel (a table of payments or sign-ups); replaces the orders table. The panel keeps its title (labels.orders) and See all link (ordersHref).
tasksDashboardTask[]The Needs attention rows ({ id, title, description, tone, href, count, icon }); defaults to ADMIN_DASHBOARD_SAMPLE.tasks. An empty list shows "All good".
activityTimelineItemData[]The team feed with actors and times; defaults to ADMIN_DASHBOARD_SAMPLE.activity (8 items).
topProducts{ id; title; quantity; revenue; trend? }[]The Products sold table, with a 14 day sparkline from trend; defaults to the five Summit CRM products of the sample.
comparedefaulttruebooleanThe dashed previous-period series, the revenue change and the KPI deltas.
chartTypedefault"area""area" | "line"The revenue chart: AreaChart, or LineChart with a soft area.
granularity"day" | "week"The revenue grouping, controlled; pair it with onGranularityChange.
defaultGranularitydefault"day""day" | "week"The revenue grouping while uncontrolled; week falls back to days for periods under 14 days.
onGranularityChange(granularity: DashboardGranularity) => voidCalled when the Daily / Weekly switch changes.
showAttentiondefaulttruebooleanThe Needs attention panel beside the chart.
attentionEmptydefault"compact""compact" | "panel" (AdminDashboardPageAttentionEmpty)With no tasks (tasks=[]): a slim "All good" strip above the revenue row, with the chart taking the full width, or the full Needs attention panel with its empty state. With tasks the panel always shows.
kpiIconsdefaulttruebooleanTinted icon tiles on the KPI cards: kpi.icon and kpi.tone, else an icon and a tone picked from the id (revenue orange, orders blue, clients green, conversion amber).
chartTonedefault"""neutral" | "brand" | "success" | "warning" | "danger" | "info"The revenue line's color. Unset, it follows tone (neutral: the chart's first series color); the previous period stays a muted dashed line.
showActivitydefaulttruebooleanThe team activity feed.
showTopProductsdefaulttruebooleanThe Products sold table.
topProductsColumnsdefault"["quantity", "revenue", "trend"]"("quantity" | "revenue" | "trend")[]The value columns of the top table, in order. The first one is the phone card's value; ["quantity"] turns it into a plain ranking (installs, views).
ordersPageSizedefault8numberOrders per page on desktop, and per load on phones.
onOrderAction(action: DashboardOrderAction, order: DashboardOrder) => (void | Promise<unknown>)Runs a row, bulk or sheet action (confirm, cancel or print). The status changes at once and the row shows a spinner until the promise settles; a rejection rolls it back with an error toast. Without it the page waits 900 ms and toasts.
onExport(period: DateRange) => (void | Promise<unknown>)The Export action; a promise keeps the button loading. Without it a toast confirms the export.
onCreateOrder() => (void | Promise<unknown>)The New order action. Without it a toast stands in for the form.
orderSheetdefaulttruebooleanA row click opens the order sheet; false only calls onOrderClick.
onOrderClick(order: DashboardOrder) => voidCalled when a row or its View action is chosen (before the sheet opens).
defaultOpenOrderdefault""stringAn order id whose sheet is open on mount (o1042 is the one in delivery).
ordersHrefdefault"/orders"stringWhere the orders panel's See all goes.
activityHrefdefault"/activity"stringWhere the activity panel's See all goes.
labelsPartial<AdminDashboardPageLabels>Every visible string (English, DEFAULT_ADMIN_DASHBOARD_PAGE_LABELS; ADMIN_DASHBOARD_PAGE_LABELS_EN is the same set). Nested keys (statCard, chart, dateRange, ordersTable, table, list, timeline, orderTracker, sparkline) translate the composed items.
localedefault"en-US"stringIntl locale for numbers, money and dates.
currencydefault"USD"stringISO 4217 code for the KPIs, the chart, the orders and the products.
nowDate | numberThe reference time for today, the presets and the relative times; default the live clock.
tonedefault"neutral""neutral" | "brand" | "success" | "warning" | "danger" | "info"The primary actions, the KPI sparklines and goal bar, the chart's current series and the date selection.
radiusdefault"md""sm" | "md" | "lg"Corner size of the KPI tiles and the panels (12 / 16 / 24px).
loadingdefaultfalsebooleanSkeletons in the real layout: the header, the tiles, the chart, the rows and the feed.
animateIndefaulttruebooleanSections rise in once when the page mounts on the client; off in thumbnails and under reduced motion.
linkComponentdefault"<a>"(props: LinkComponentProps) => ReactNodeThe router link for the panel links and the attention rows; default the surrounding LinkProvider's (the admin shell's).
classNamestringClasses for the root.
classNamesPartial<Record<AdminDashboardPageSlot, string>>Classes for header, kpis, row, revenue, attention, orders, top, activity and orderSheet.
Parts
DEFAULT_ADMIN_DASHBOARD_PAGE_LABELS
constantEvery English string of the dashboard: greeting, period, KPI names, chart, orders, alerts and activity. Spread it and override what you translate.
ADMIN_DASHBOARD_PAGE_LABELS_EN
constantAn alias of DEFAULT_ADMIN_DASHBOARD_PAGE_LABELS, kept so older imports keep working.
generateDashboardData
functionBuilds the whole dashboard (KPIs, revenue series, orders, alerts) for one period; the same period and seed always give the same numbers.
sampleTasks
functionReturns the sample alerts: overdue invoices, unconfirmed orders, low stock and a failed payment, each with a tone and a link.
sampleActivity
functionReturns the team's latest actions for the activity timeline, timed relative to a given now.
ADMIN_DASHBOARD_SAMPLE
constantThe demo dashboard for the default period, with its period and now. Replace it with data from your API.
ADMIN_DASHBOARD_DEFAULT_PERIOD
constantThe period the dashboard opens on when defaultPeriod is not set: the 30 days up to the sample's now (August 26 to September 24, 2026).
ADMIN_DASHBOARD_NOW
constantThe fixed "now" of the sample (September 24, 2026, 4:40 PM), so server and client render the same numbers.
ADMIN_DASHBOARD_ORDER_IDS
constantThe four sample order ids the demo offers for defaultOpenOrder.
Examples
Order sheet open on #1042
defaultOpenOrder="o1042": out for delivery with UPS, tracking 1Z 999 AA1 01 2345 678.
Loading
loading: skeleton tiles, chart, rows and feed in the real layout.
An empty period
January 1 to January 7, 2026, the office was closed: KPIs show a dash, the table offers another period.
Launch day
No sales yet: zero KPIs read No change, the revenue panel is one row, All good is a slim strip and empty tables drop their headers.
Brand tone, weekly line chart
tone="brand", chartType="line", defaultGranularity="week".
All clear, no comparison
tasks={[]} shows All good; compare={false} hides the previous period and the deltas.
Your own sections
recent replaces the orders table, children add sections, topProductsColumns={["quantity"]} and two presets.
British English, euros
locale="en-GB", currency="EUR" with a controlled period regenerating the sample.
Dependencies
Files
- components/blocks/admin-dashboard-page.tsx
- components/blocks/admin-dashboard-page-data.ts
FAQ
Is the React Admin Dashboard Page block free?
The preview, props and docs are free; copying the source needs a Pro plan. See plans.
How do I install Admin Dashboard Page?
Run npx wingo-ui@latest add admin-dashboard-page. It also adds the Wingo UI items it builds on (Alert Dialog, Area chart, Avatar, Badge, Button and 26 more) and the npm packages motion and lucide-react. With shadcn, add the @wingo-ui registry with your API key, then run npx shadcn@latest add @wingo-ui/admin-dashboard-page.
How does Admin Dashboard Page behave on phones?
Pick the period in the date range field (presets such as Last 7 days or Last month beside two months on desktop, a bottom sheet on phones): every panel fades to the new numbers, the KPI values count to theirs and the chart grows again.
See also
More React blocks
Articles using this component
- Best shadcn Templates in 2026: Free and Paid, Tested
Comparisons and alternatives11 min read
- Nextjs Admin Dashboard Tutorial: 5 Screens, Phone-Ready
Build it: screens and apps23 min read