Overview
The Dashboard is the central hub of CryptoDash, providing a comprehensive real-time view of your cryptocurrency portfolio, market trends, and key performance metrics. It combines summary statistics, interactive charts, and live market data in a responsive, easy-to-read layout.Key Components
The Dashboard consists of three main sections:Summary Cards
Four KPI cards showing total balance, 24h change, profit/loss, and total assets
Performance Chart
Interactive Bitcoin price chart with hover tooltips showing historical trends
Market Table
Live data for top cryptocurrencies with sparklines and real-time prices
Summary Cards
Four essential metrics displayed at the top of the dashboard:Total Balance
Aggregated USD value of all assets in your portfolio, calculated from CoinGecko market prices.24h Change
Percentage and dollar change in your total portfolio value over the last 24 hours.Profit/Loss
Net gains or losses since initial investment, color-coded green for gains and red for losses.Total Assets
Number of different cryptocurrencies currently held in your portfolio.All summary cards feature animated count-up values using the
CountUpValue component for smooth number transitions.Performance Chart
An interactive line chart displaying Bitcoin’s price history over the selected time period.Features
- Interactive Tooltips: Hover over the chart to see exact price and timestamp
- SVG Path Rendering: Smooth line chart generated from historical price data
- Responsive Design: Adapts to mobile, tablet, and desktop screen sizes
- Performance Metrics: Shows current price, 24h change, and trend direction
Implementation
The chart uses theMainPerformanceChart component:
MainPerformanceChart.jsx
useDashboardData hook, which calls the CoinGecko API to retrieve Bitcoin’s historical prices:
Market Table
Displays the top cryptocurrencies by market cap with live prices, changes, and 7-day trend sparklines.Columns
| Column | Description |
|---|---|
| Rank | Market cap rank (1-based) |
| Asset | Coin name and symbol with icon |
| Price | Current price in USD |
| 24h % | 24-hour price change percentage |
| Market Cap | Total market capitalization |
| Volume | 24-hour trading volume |
| Last 7 Days | Sparkline chart showing 7-day price trend |
Sparklines
Each row includes a mini sparkline chart showing the 7-day price trend:dashboardCharts.js
- Green (#2bee79): Positive 7-day change
- Red (#ff4d4d): Negative 7-day change
Data Source
All dashboard data comes from the CoinGecko API via theuseDashboardData hook:
DashboardPage.jsx
The dashboard automatically refreshes data every 60 seconds to ensure you’re seeing the latest market information.
Loading States
While fetching data, the dashboard displays skeleton loaders:- Card Skeletons: Animated placeholder cards
- Chart Skeleton: Placeholder for the performance chart
- Table Skeletons: 8 placeholder rows with animated shimmer effect
DashboardPage.jsx:25-36
Responsive Design
The dashboard layout adapts to different screen sizes:- Mobile (< 768px): Single column, stacked cards
- Tablet (768px - 1024px): 2-column grid for summary cards
- Desktop (> 1024px): 4-column grid for summary cards
Error Handling
If the API request fails, an error message is displayed:Related Documentation
Components
Learn about SummaryCardsGrid, MainPerformanceChart, and MarketTable
useDashboardData Hook
API reference for the main dashboard data hook
API Integration
How CryptoDash fetches data from CoinGecko
Charts
Interactive chart components and utilities
