Preparing the daily counts…
Analytics dashboard.
A reporting workflow with clear metrics, explorable charts and exact CSV export.
THE NUMBERS, WITH CONTEXT
Analytics workspace.
Daily request counts and outcomes for the selected period.
Calculating the proportion…
Comparing the daily totals…
Loading report…
Live interface · sample data · state resets on reload
GET STARTED
Source you can customise.
npx shadcn@latest add https://ui.bld8.dev/r/analytics-dashboard.jsonInstall into an existing application, or download the complete starter below.
Download the starter, unzip it and run the commands below. Choose Next.js or React + Vite. Both include the same BLD8 packages and editable source. No BLD8 npm installation is needed.
npm install
npm run devNext.js opens on http://localhost:3000; Vite opens on http://127.0.0.1:5173. Use the port printed by the dev server if the default is occupied. Node 22.13+ and React 19 are used. Import AnalyticsDashboard from @bld8/blocks in your own composition.
Moving between Next.js and Vite? Keep the UI source and review the application-specific changes.
NOTES TO SELF
A clear starting point.
The default shows deterministic illustrative reports. Choose 7, 30 or 90 days, compare line/bar/area views, toggle series, explore points and open the exact data table. Total requests, completion rate and peak-day counts derive from the same records. Supply a stable loadReport(period, {signal}) callback to connect your service. The block validates matching periods, unique IDs/labels and nonnegative safe integer counts, ignores stale results and supports retry. Empty and loading reports remain explicit. CSV quotes fields and protects against spreadsheet formulas. The host owns collection, date boundaries, timezones, aggregation, authorisation and storage; no live analytics service is included.
Original BLD8 source uses MIT. Personal and commercial use are allowed; preserve the copyright, licence and applicable third-party notices when sharing source.
Licence and usage Source manifestPublic API
Generated from the same public TypeScript exports as the agent documentation. The host owns the service contracts described above.
AnalyticsDashboard
| Prop | Type | Default |
|---|---|---|
className | string | undefined | — |
defaultPeriod | AnalyticsPeriod | undefined | 'week' |
loadReport | ((period: AnalyticsPeriod, context: { signal: AbortSignal; }) => Promise<AnalyticsReport>) | undefinedKeep the callback stable while browsing. The host owns authorisation and aggregation. | — |
Tables come from the public TypeScript declarations. Related types and function parameters are shown alongside their component. A dash means no default is declared at the public function boundary.