Design SystemPatternsMarketMarketCard

MarketCard

Reference照 app.opinion.trade 線上產品重建的對照版,用來量測與討論。不是 production 的程式碼。

Installation

import { MarketCard } from "@/components/product/market-card/market-card";

Overview

Market card for feed grids, hero placements, and sidebar rows. Renders either a single-outcome market (with an author byline) or a multi-outcome group (a ranked list of named outcomes with percentages). Status is either active or resolved — resolved group outcomes each carry their own resolution (yes / no / tie) so the winning row(s) can be visually marked. The title is optionally pressable independent of the favorite toggle.

Height rules

  • default — fixed h-[198px], component-owned (p-3 + header + body + mt-auto + footer + p-3)
  • hero — h-full, sized by parent container
  • row — content-driven height

Interactive Demo

Interactive components for verifying state changes (favorite toggle, title press).

Largest Company end of May?
Oliver James Carter
40%
Liam Alexander Foster
40%
Vol. $72.4K USDO
Will Bitcoin exceed $200k?
by cryptoking
80% Chance
Vol. $589.0K USDO
Who will win the 2025 election?
Candidate A
8%
Candidate B
8%
Candidate C
8%
Candidate D
8%
Candidate E
8%
Candidate F
8%
Candidate G
8%
Candidate H
8%
Candidate I
8%
Candidate J
8%
Candidate K
8%
Candidate L
8%
Vol. $1.3M USDO

Default Layout — State Matrix

All default layout states. Fixed h-[198px]. Group body = 82px viewport (2.5 rows, gap-1.5). Verifies height, spacing, overflow scroll.

DEFAULT + GROUP + ACTIVE

Largest Company end of May?

Largest Company end of May?

Oliver James Carter
40%
Liam Alexander Foster
40%
Vol. $72.4K USDO
Who will win the 2026 presidential election?

Who will win the 2026 presidential election?

Candidate A
55%
Candidate B
30%
Candidate C
15%
Vol. $1.3M USDO
Many outcomes — scroll test

Many outcomes — scroll test

Candidate A
8%
Candidate B
8%
Candidate C
8%
Candidate D
8%
Candidate E
8%
Candidate F
8%
Candidate G
8%
Candidate H
8%
Candidate I
8%
Candidate J
8%
Candidate K
8%
Candidate L
8%
Vol. $500.0K USDO

DEFAULT + GROUP + RESOLVED

Largest Company end of May?

Largest Company end of May?

Oliver James CarterYES
Liam Alexander FosterNO
Vol. $72.4K USDO
Resolved TIE outcome

Resolved TIE outcome

Oliver James CarterTIE
Liam Alexander FosterTIE
Vol. $72.4K USDO

DEFAULT + SINGLE + ACTIVE

Largest Company end of May?

Largest Company end of May?

by oliviarhye
80% Chance
Vol. $72.4K USDO

DEFAULT + SINGLE + RESOLVED

Largest Company end of May?

Largest Company end of May?

by oliviarhye
Resolved: YES
Vol. $72.4K USDO
Will Bitcoin exceed $200k?

Will Bitcoin exceed $200k?

by cryptoking
Resolved: NO
Vol. $589.0K USDO

Hero Layout — State Matrix

Hero uses h-full — height controlled by parent. Container below is 400px to verify fill behavior.

HERO + SINGLE + ACTIVE

80% Chance
Vol. $72.4K USDO

HERO + SINGLE + RESOLVED

Will an Ethereum ETF be approved within this year?

Resolved: YES
Vol. $72.4K USDO

HERO + GROUP + ACTIVE

Candidate A
55%
Candidate B
30%
Candidate C
15%
Vol. $1.3M USDO

HERO + GROUP + RESOLVED

Which company was the largest as May concluded?

Oliver James CarterYES
Liam Alexander FosterNO
Vol. $72.4K USDO