Modules
Dashboards
Analytics, store, finance and SaaS dashboards built from KPI cards, chart cards and tables.
The four dashboards are compositions of Base components fed by one composable each. They are the only screens with KPI cards: operational modules link here for the numbers.
Files
File | Role |
|---|---|
pages/dashboard/analytics.vue | AppWelcomeHeader, KPIs, traffic chart, devices, goals, activity and last users. |
pages/dashboard/e-commerce.vue | Sales KPIs, revenue chart, countries, top products, low stock and recent orders. |
pages/dashboard/finance.vue | Balance KPIs, cash flow, accounts, budget, a summary list and transactions. |
pages/dashboard/saas.vue | MRR and churn KPIs, growth chart, funnel and top accounts. |
composables/ | useAnalyticsKpis, useAnalyticsActivity, useAnalyticsLabels, useEcommerceDashboard, useFinanceDashboard, useSaasDashboard. |
mocks/ | analytics.mock.ts, ecommerce.mock.ts, finance.mock.ts, saas.mock.ts. |
components/pages/dashboard/ | One component per card that does not fit a Base primitive, prefixed with the dashboard name. |
Data
Mocks hold semantic ids (totalUsers, desktop, mon), never i18n keys. The page resolves each id to a label (for analytics through useAnalyticsLabels()), so replacing a mock with an API does not leak keys into the UI.
The period selector of every dashboard comes from useDashboardPeriod(): the choice (this week, month, quarter or year) is kept in the dashboard-period cookie, and kpiForPeriod() in utils/dashboard-period.ts rescales each KPI card and its comparison label (sum metrics such as revenue grow with the period, level metrics such as MRR only change their trend). Swap it for a query to your API when you connect a backend. Numbers are formatted with useNumberFormat().
Permissions
Every dashboard needs dashboard.view.
How it works
- KPI figures use
BaseKpiCard(.kpi-value), charts useBaseChartCardwith apreset. Never pass hex colours to a chart: colours come fromuseChartColors(). See Charts. - Tables are
BaseDataTablewithresponsive-columns, so they fit the boxed container. - Actions that need a backend (export, download a report) show the demo toast.