I'll build a comprehensive SaaS analytics dashboard with all the features requested. Let me start by exploring the project structure and then build everything.
Good, I have a clear picture. Now I'll install the charting library and build everything. Let me install recharts for charts and lucide-react for icons.
Now let me update the index.html title and create all the files. I'll start with the CSS, then data layer, components, and finally App.tsx.
Now create the data generation utility:
Now let me create all the component files. I'll start with the types and utility hooks:
Now the chart components:
Now the data table component:
Now the filters component:
Now create the Header component:
Now the main App.tsx that ties everything together:
Now let's build the project to check for errors:
The build succeeds. Let me verify the output looks correct by checking the generated index.html:
The build succeeded and everything is bundled. Let me do final review to make sure the project structure is complete:
Everything is in place. The dashboard is fully built and working. Here's a summary of what was created:
SaaS Analytics Dashboard — Complete
Architecture
src/App.tsx — Main orchestrator with state management for filters, generates fresh data on every filter change
src/index.css — Full Tailwind v4 theme with custom dark: variant, CSS custom properties for light/dark surfaces, smooth transitions, and recharts tooltip styling
src/utils/data.ts — Realistic data generator producing daily revenue, user metrics, feature usage, segment breakdowns, and campaign table rows with natural trends, weekend dips, and noise
Components Built
| Component | Description |
|---|
| Header | Sticky header with logo, dark mode toggle, and dual filter controls (date range + segment) |
| DateFilters | 5 date range buttons (7D/14D/30D/60D/90D) + segment dropdown |
| KPICard | Animated KPI cards with icons, trend percentage badges, and mini progress bars |
| RevenueChart | Stacked area chart (Revenue/Expenses/Profit) with gradient fills and custom tooltips |
| UsersChart | Grouped bar chart (Active/New/Churned users) with rounded corners |
| SegmentDonut | Donut pie chart with custom tooltip showing revenue % by customer tier |
| FeatureBar | Horizontal bar chart of feature adoption ranked by active users |
| DataTable | Sortable (click any column header), filterable (search + status), paginated table with 8 rows/page |
Features
- Dark mode toggle — Persisted to localStorage, respects system preference
- Live filter updates — Changing date range or segment regenerates all data instantly
- Smooth animations — Cards fade in sequentially, chart bars/areas animate via recharts
- Hover tooltips — Custom styled tooltips with proper dark mode on every chart
- Fully responsive — Grid layout adapts from 1 to 4 columns, table scrolls horizontally on mobile
- Clean visual hierarchy — CSS custom properties for consistent light/dark theming, subtle shadows, clean typography
Files built: index.html, src/index.css, src/utils/data.ts, src/hooks/useDarkMode.ts, src/components/KPICard.tsx, src/components/RevenueChart.tsx, src/components/UsersChart.tsx, src/components/SegmentDonut.tsx, src/components/FeatureBar.tsx, src/components/DataTable.tsx, src/components/DateFilters.tsx, src/components/Header.tsx, src/App.tsx