Code GenerationClaude / ChatLLM DeepAgent

React Dashboard Component Builder

Generate a complete analytics dashboard with charts, KPI cards, data tables, and filters using React and Recharts.

The Prompt

Build a React analytics dashboard for this use case:

Dashboard name: [name]
Industry/purpose: [e.g., SaaS metrics, e-commerce analytics, marketing performance]
Key metrics to show: [list 4–6 KPIs with names and data types]
Chart types needed: [line chart, bar chart, pie chart, area chart — list which]
Data source: [mock data for now / REST API endpoint: specify]
Date range filter: [yes/no]
Tech stack: React + TypeScript + Tailwind CSS + Recharts

Build these components:

1. Dashboard layout:
   - Sidebar navigation
   - Header with date range picker and user avatar

2. KPI cards row (4 cards):
   - Metric value with trend arrow
   - Percentage change vs previous period
   - Mini sparkline chart

3. Main chart section:
   - Primary chart (line/area) with legend and tooltips
   - Secondary chart (bar) side by side

4. Data table:
   - Sortable columns
   - Pagination (10 rows per page)
   - Export to CSV button
   - Row hover highlight

5. Mock data generator function that produces realistic sample data

Use Tailwind for all styling. Make it dark theme by default.

Tips for Best Results

  • Add loading skeleton states for each component while data fetches
  • Use React.memo on chart components to prevent unnecessary re-renders

Tags

ReactdashboardanalyticsRechartsTypeScript

Related Prompts