Skip to content

Ecommerce Dashboard for React

An ecommerce sales dashboard template for React with orders, top products, a conversion funnel and a regional map.

With demo data:npx shadcn@latest add https://lokendra-builds.github.io/sheenui/r/analytics-demo-ecommerce.json

E-commerce

last 7 days

  • EcommerceDashboard
  • BarTrendChart
  • defaultEcommerceLabels
  • +1 more

Live demo

Filter by sales channel and the whole store re-shapes (the mobile app sells pricier baskets, social converts less). Bars grow from the baseline in a wave; Compare adds last period's revenue as a dashed line. Hover a bar to read revenue, the moving average and the change; click a category to zoom into it.

Lumen & Co.

Sales · Last 30 days

Revenue

Net sales after discounts and refunds · Last 30 days

  • Revenue
  • Moving average

Checkout funnel

Sessions to purchase

Sales by category

Revenue share; select a category to zoom in

Top products

By revenue

When people buy

Orders by hour and weekday

Files to copy

18 folders · 51 files · 4 packages
From theme/src/
  • blocks/{analytics-ecommerce.tsx, analytics-kit.ts, icons.tsx}
  • components/button/
  • components/charts/{bar-list.tsx, chart-export-menu.tsx, chart-export.ts, chart-figure.tsx, chart-fit.tsx, chart-icons.tsx, chart-parts.tsx, chart-patterns.tsx, chart-tip.tsx, chart-utils.ts, combo-chart.tsx, funnel-chart.tsx, heatmap.tsx, sparkline.tsx, treemap.tsx}
  • components/charts/chart-parts/
  • components/charts/heatmap/
  • components/drawer/parts/sheet.tsx
  • components/kbd/
  • components/menu/
  • components/segmented/
  • components/skeleton/
  • components/spinner/
  • components/status-icons/
  • components/tabs/
  • blocks/analytics/{bar-trend-chart.tsx, data.ts, glass.tsx, hooks.tsx, kpi.tsx, labels.ts, panel.tsx, shell.tsx, stacked-trend-chart.tsx, trend-chart.tsx, trend-frame.tsx}
  • hooks/{use-controllable.ts, use-direction.ts, use-intersection.ts, use-latest.ts, use-magnetic.ts, use-media-query.ts, use-preferences.ts}
  • motion/{beat.ts, gate.ts, tokens.ts}
  • lib/{cn.ts, csv.ts, form.ts, glide-highlight.tsx, heading.ts, math.ts, no-script-reveal.tsx, popup-a11y.ts, popup-motion.ts, state-light.tsx, warn-once.ts}
  • styles/
shadcn CLI (component only)
npx shadcn@latest add https://lokendra-builds.github.io/sheenui/r/analytics-ecommerce.jsonRegistry item: analytics-ecommerce. The styles need the Tailwind v4 glass UI setup.
Packages
pnpm add @base-ui/react clsx motion tailwind-merge

Next.js: samples here pass functions (formatters, seriesLegend, a dashboard's load), so put them in a file that starts with "use client".

A live store, controlled

range is controlled here (the buttons above and the header stay in sync), Live and Compare start on, amounts are in pounds for en-GB. Orders land every few seconds: revenue rolls, the current hour grows and the funnel counts up.

Northwind Goods

Sales · Last 24 hours

Revenue

Net sales after discounts and refunds · Last 24 hours

  • Revenue
  • Moving average
  • Previous period

Checkout funnel

Sessions to purchase

Sales by category

Revenue share; select a category to zoom in

Top products

By revenue

When people buy

Orders by hour and weekday

Loading, empty and error states

The frame never disappears: skeletons hold every panel's place on the first load, later loads dim the charts under a scan line, and an empty or failed load says so in words (with Retry when the loader threw). Pin a state with status for docs and tests.

Lumen & Co. (status demo)

Sales · Last 30 days

Revenue

Net sales after discounts and refunds · Last 30 days

  • Revenue
  • Moving average

Checkout funnel

Sessions to purchase

Sales by category

Revenue share; select a category to zoom in

Top products

By revenue

When people buy

Orders by hour and weekday

Data

load is required: EcommerceDashboard never invents numbers. Return your own data (or a promise of it) from load. For demos and prototypes use the sample loader and live step from the separate @sheenui/theme/demo-data module:

import { EcommerceDashboard } from "@/components/sheenui/blocks/analytics-ecommerce";
// Package build (after the first npm release, or a packed tarball): import { EcommerceDashboard } from "@sheenui/theme";
import { ecommerceDemoLoader, ecommerceLiveStep } from "@/components/sheenui/blocks/analytics/demo-ecommerce";
// Package build (after the first npm release, or a packed tarball): import { ecommerceDemoLoader, ecommerceLiveStep } from "@sheenui/theme/demo-data";

<EcommerceDashboard load={ecommerceDemoLoader} liveStep={ecommerceLiveStep} />

With the shadcn CLI the sample data is its own optional item, which also installs the dashboard (the “with demo data” command at the top of this page): npx shadcn@latest add https://lokendra-builds.github.io/sheenui/r/analytics-demo-ecommerce.json. The “component only” command under Files to copy leaves the sample data out, which is what a production build wants.

Props

PropTypeDefaultDescription
load (required)AnalyticsLoader<EcommerceData>NoneLoads the data for a range + filters (sync or async). Required: no dashboard falls back to fake data. The demo loaders live in @sheenui/theme/demo-data, which the package root does not export.
liveStep((prev: EcommerceData, tick: number) => EcommerceData)NoneEvolves the data on each live tick (omit for no live updates). Return a new object; unchanged parts keep their identity.
rangeAnalyticsRangeNoneSets the active range when controlled. Pair with onRangeChange.
defaultRangeAnalyticsRangeper dashboardThe range at first when range is not controlled (AnalyticsRange); each dashboard picks its own.
onRangeChange((range: AnalyticsRange) => void)NoneCalled when the range changes.
activeFiltersstring[]NoneValues of the active filter chips (controlled).
defaultFiltersstring[]noneThe filters on at first when activeFilters is not controlled (string[], default none).
onFiltersChange((filters: string[]) => void)NoneCalled when the filter chips change.
livebooleanNoneSimulated live updates. The Live toggle pauses them (WCAG 2.2.2).
defaultLivebooleanper dashboardWhether live updates are on at first when live is not controlled (boolean); each dashboard picks its own.
onLiveChange((live: boolean) => void)NoneCalled when the Live toggle changes.
comparebooleanNoneShow the previous period (dashed lines, "vs" values).
defaultComparebooleanper dashboardWhether the comparison is on at first when compare is not controlled (boolean); each dashboard picks its own.
onCompareChange((compare: boolean) => void)NoneCalled when the Compare toggle changes.
statusAnalyticsStatus"auto"Pin a state (docs, tests); "auto" follows the loader.
storestring"Lumen & Co."Store shown as the title (also names the dashboard landmark).
currencystring"USD"Sets the ISO 4217 currency of every amount.
rangesreadonly AnalyticsRange[]all fiveRanges offered in the header (readonly AnalyticsRange[], default all five).
filtersreadonly AnalyticsFilter[]NoneSales-channel filter chips. Their values reach load as filters.
onExport((data: EcommerceData) => void)a CSV of revenue and ordersCalled by Export (default: a CSV of revenue and orders).
headingLevelHeadingLevelOption2Heading level of the title (1 to 6), or "none" for a paragraph with no heading role (panel titles follow).
localestringthe runtime'sBCP 47 locale for every number and date (string, default the runtime's).
labelsPartial<EcommerceLabels>defaultEcommerceLabelsEvery other string, for translation: labels={{ range: "…" }}; omitted keys keep the English of defaultEcommerceLabels. All 49 keys of EcommerceLabels are listed in the key table under the props table.
classNamestringNoneAdds extra classes to the root <section> (string).
EcommerceLabels keys and English defaults (49)
Pass any key in labels; the rest keep the defaults of defaultEcommerceLabels.
KeyEnglish default
rangeTime range
ranges{ "24h": "24h", "7d": "7d", "30d": "30d", "90d": "90d", "12m": "12m" }
rangeNames{ "24h": "Last 24 hours", "7d": "Last 7 days", "30d": "Last 30 days", "90d": "Last 90 days", "12m": "Last 1...
filtersFilter by sales channel
liveLive
liveDescriptionUpdate the numbers in real time
compareCompare
compareDescriptionCompare with the previous period
exportExport
exportedCSV downloaded
loadingLoading new data…
loadedDashboard updated
chartChart
tableTable
viewAs(title) => `${title}: view as`
change(direction, amount) => direction === "flat" ? "No change vs previous period" : `${direction === "up" ? "Up"...
noChangeNo change vs previous period
kpisSales metrics
vsPrevious(value) => `vs ${value} before`
previousPeriodPrevious period
changeLabelChange
chartInstructionsUse the left and right arrow keys to read values.
touchHintTouch and drag to read values
noDataNo data
errorTitleCouldn't load the dashboard
errorDescriptionThe data source didn't answer. Check your connection and try again.
retryTry again
emptyTitleNo data for this view
emptyDescriptionNothing was recorded in this time range with these filters. Try a longer range or clear the filters.
subtitle(range) => `Sales · ${range}`
metrics{ revenue: "Revenue", orders: "Orders", aov: "Avg. order value", conversion: "Conversion rate" }
channels{ store: "Online store", marketplace: "Marketplace", app: "Mobile app", social: "Social" }
revenueRevenue
revenueDescriptionNet sales after discounts and refunds
movingAverageMoving average
funnelCheckout funnel
funnelDescriptionSessions to purchase
stages{ sessions: "Sessions", productViews: "Viewed a product", addToCart: "Added to cart", checkout: "Reached ch...
categoriesSales by category
categoriesDescriptionRevenue share; select a category to zoom in
categoryLevelsCategory level
heatmapWhen people buy
heatmapDescriptionOrders by hour and weekday
hourHour
weekdayDay
productsTop products
productsDescriptionBy revenue
productProduct
dateDate

BarTrendChart props

PropTypeDefaultDescription
data (required)BarTrendDatum[]NoneLists the bars, oldest first (BarTrendDatum[], required).
seriesLabel (required)stringNoneName of the bar series (string, required): tooltip and table.
lineLabelstringNoneName of the line series (omit to hide the line).
colorChartColor1Sets the palette slot (1–8) used for the bars.
lineColorChartColor2Sets the palette slot (1–8) used for the line.
comparebooleanfalseDraw the previous period as a dashed, muted line.
heightnumber300Sets the plot height in pixels (number, default 300).
format((n: number) => string)formatCompactFormats values in the axis and tooltip ((n: number) => string, default compact).
localestringthe runtime'sBCP 47 locale for dates and numbers in announcements (string, default the runtime's).
labelsPartial<Pick<AnalyticsLabels, "noData" | "previousPeriod" | "changeLabel" | "chartInstructions" | "touchHint">>defaultAnalyticsLabelsEvery other string, for translation: labels={{ previousPeriod: "…" }}; omitted keys keep the English of defaultAnalyticsLabels. All 5 keys of AnalyticsLabels are listed in the key table under the props table.
aria-label (required)stringNoneNames the chart for assistive tech (string, required).
classNamestringNoneAdds extra classes to the chart's wrapper (string).
AnalyticsLabels keys and English defaults (5)
Pass any key in labels; the rest keep the defaults of defaultAnalyticsLabels.
KeyEnglish default
previousPeriodPrevious period
changeLabelChange
chartInstructionsUse the left and right arrow keys to read values.
touchHintTouch and drag to read values
noDataNo data

EcommerceData

PropTypeDefaultDescription
points{ label, long?, revenue, orders, previousRevenue? }[]NoneRevenue and orders per point.
kpis / previousKpis{ revenue, orders, aov, conversion }NoneTakes headline numbers (conversion as a ratio).
trendsRecord<metric, number[]>NoneGives the sparkline values for each KPI, keyed by metric.
funnel{ stage: "sessions" | "productViews" | "addToCart" | "checkout" | "purchase", value }[]NoneTakes visitors at each checkout step.
categoriesTreemapNode[]NoneTakes revenue by category → product type.
heatmap{ day, hours: number[24] }[]NoneOrders by weekday × hour, Monday first.
productsBarListItem[]NoneLists the top products by revenue.

Keyboard

KeysAction
Tab/Shift+TabMove through the header controls, the KPIs, each chart and its Chart / Table switch.
←/→Move the time range (Segmented control), the KPI tabs, the Chart / Table switch, or the point being read in a chart.
Home/EndFirst / last KPI tab, or first / last point of a chart.
Enter/SpaceToggle Live, Compare or a filter chip; press Export; sort a table column.
EscStop reading a chart (hides the crosshair and tooltip).
Enter (treemap)Zoom into a category; the breadcrumb zooms back out.

Accessibility

  • The revenue chart keeps bars and the line on one axis (they share a unit); the legend names both and the Table view lists revenue and the line per period.
  • The funnel reads each stage with its share of the first and of the previous stage, and how many dropped off between them.
  • The heatmap is a keyboard grid with a sequential, single-hue scale and a legend; every cell reads its weekday, hour and number of orders. On phones it scrolls inside its own panel.
  • Reduced motion: no grow-from-baseline, no tile glides, no pulses.

Performance

  • Charts below the fold mount when they come within 320px of the viewport; their frame is reserved first, so nothing shifts.
  • New data lands in a React transition, one panel per frame: visible panels ripple in order, panels off-screen catch up in idle time or when you scroll to them.
  • Controls answer instantly (optimistic state) while the dashboard re-renders in the background, so a click never blocks the next frame.
  • Loading dims the panels through a data attribute (CSS only): starting or finishing a load re-renders no chart.
  • Glass budget: the header, the KPI strip and at most two panels per row blur what's behind them; controls inside the header don't add their own blur. Phones get a lighter blur.
  • Live updates, the realtime stream and every pulse stop while the dashboard is off-screen or the tab is hidden. Only transform and opacity animate.

All exports on this page

  • BarTrendChart — Bars (≤ 24px, rounded data-end, 2px gaps) with a line on the same axis and the previous period dashed.
  • EcommerceDashboard — Props (see EcommerceDashboardProps): store ("Lumen & Co."), currency ("USD"), ranges, filters (sales-channel chips), onExport.
  • defaultEcommerceLabels — The English EcommerceLabels used when labels is omitted; a partial labels prop is merged over them.

When to use the e-commerce dashboard

  • Use it as a sales dashboard template for a store admin home screen that shows revenue, orders, average order value and conversion rate for a chosen period with rolling numbers and deltas.
  • Use it for a weekly sales review where revenue bars sit beside the previous period or a moving average, with a checkout funnel from sessions to purchase and a category treemap.
  • Use the filters prop for sales channels like store, marketplace, app and social, then return the matching channel data from load.
  • Skip it when you sell subscriptions, where SaasRevenueDashboard handles MRR and churn, or when you only need a single tile; the stat cards block fits better for one headline number.
  • Pair it with Treemap, Heatmap and FunnelChart when you build custom panels, plus Badge and Button for order status and actions around the dashboard.

Frequently asked questions

5 dashboards pages in all: browse them on All dashboards.

By Lokendra Singh Rathore (GitHub, opens in a new tab). Published , updated .