Skip to content

[Frontend] MarketStats Component – DashboardΒ #13

@aguilar1x

Description

@aguilar1x

🎯 Objective

Build the MarketStats component to display key Soroswap market data inside the dashboard.


πŸ— Component Structure

apps/webapp/components/dashboard/market-stats.tsx

πŸ—‚ Requirements

Section Header

  • Small chart-trend-up icon (muted gray).
  • Heading: Market Stats in font-semibold.

Stats List

  • Total Volume (24h): $1.2M
  • Total Liquidity: $8.4M
  • Active Pairs: 12
  • XLM Price: $0.095 (in green text-green-500)

Layout:

  • Label aligned left, value aligned right.
  • Use monospace or tabular-nums for values to ensure clean alignment.

🎨 Design & Styling

  • White card background, rounded-xl, soft shadow.
  • Padding: p-4 (mobile) / p-6 (desktop).
  • Label text: text-gray-500 text-sm.
  • Values: text-gray-900 font-medium.
  • Positive price change (XLM Price) in text-green-500.

βš™οΈ Functionality

  • Accept props for volume, liquidity, pairs, and xlmPrice to allow dynamic updates.
  • Optionally include a loading skeleton state for async data fetching.

πŸ“± Responsiveness

  • Mobile: full width.
  • Desktop: fixed width or flex item in a grid.

β™Ώ Accessibility

  • Use aria-label="Market statistics" on container.
  • Ensure color contrast passes WCAG AA.
  • Icon is decorative (aria-hidden="true").

βœ… Acceptance Criteria

  • Matches the provided design visually.
  • Displays all four stats with correct alignment and styling.
  • Fully responsive and accessible.
  • Supports dynamic values without breaking layout.

πŸ”— Reference

Figma design

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions