Design SystemPatternsMarketMarketHeader

MarketHeader

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

Installation

import { MarketHeader } from "@/components/product/market-header/market-header";

Overview

Market detail page header: thumbnail, market question, a meta row (volume, close date, optionally time-to-maturity), watchlist toggle, and an expandable rules panel (MarketRules). The headline shows a probability or APY-style number for one outcome with a trend indicator (positive = up, negative = down) and a "View{opposite}" toggle to flip which outcome is headlined. A separate CDS-oriented presentation is available as an opt-in variant — see CDS Variant below — which re-frames the same header around a protocol name and a 3-tier KPI hierarchy instead of the default single-outcome headline. Omitting the CDS-specific fields keeps the header in its default, legacy prediction-market framing.

Interactive Demo

Will Reza Pahlavi lead Iran in 2026?

Will Reza Pahlavi lead Iran in 2026?

Vol. 2,460,260.01 USDODec 31, 2026
YES5.4%Chance3.84%

CDS Variant

variant="cds" flips the header into a 3-tier KPI hierarchy: Tier 1 hero pair (Chance of default · Earn if no default) at 24px, Tier 2 inline context row (TVL at risk · Premium pool) at 14px, and Tier 3 trust signal (Audited N× auditors) inline in the meta row at 12px. No cards, no borders, no view toggle — both hero sides shown simultaneously. Max font size 24px.

Full CDS header (Marrow Bridge)

Marrow Bridge

Marrow Bridge

Will Marrow Bridge default or be exploited before Jun 30, 2026?

$184.0M TVL at risk$14.2M seller deposits71d to maturity, 6/293 audits (ChainSec+2)
PAYOUT· YES
4.5×
payout on default+0.2× 7d
YIELD· NO
1.4%APY
earn if no default−3.0% 7d

CDS variant without cdsMetrics (graceful — Tier 1/2/3 all skipped, falls back to default hero path)

Early-stage Protocol

Early-stage Protocol

Will Early-stage Protocol default before Sep 30, 2026?

NO8.0%Chance2.00%

CDS variant — single auditor (Tier 3 trims auditors gracefully)

Helios Lend

Helios Lend

Will Helios Lend default before Sep 30, 2026?

$842.0M TVL at risk$1.2M seller deposits163d to maturity1 audit (ChainSec)
PAYOUT· YES
12.5×
payout on default+0.6× 7d
YIELD· NO
0.2%APY
earn if no default+0.1% 7d

State Matrix

Trend direction (chrome applied by preview wrapper)

Upward trend — YES is winning.

Upward trend — YES is winning.

Vol. 72,400 USDODec 31, 2026
YES62.2%Chance27.40%
Downward trend — NO is winning.

Downward trend — NO is winning.

Vol. 72,400 USDODec 31, 2026
YES12.3%Chance8.20%