Prediction Market Cards

Market listings with outcome rows and odds that roll on hover.

Preview

"use client";

import {
  PredictionMarketCard,
  type PredictionMarketCardSelection,
} from "@/components/motion/prediction-market-card";

export function PredictionMarketCardUsage({
  onTrade,
}: {
  onTrade: (selection: PredictionMarketCardSelection) => void;
}) {
  return (
    <PredictionMarketCard
      title="Boston Celtics vs. Los Angeles Lakers"
      category="Basketball"
      status="Sunday · 7:30 PM"
      volume="$2.4M"
      volumeHistory={[12, 18, 15, 26, 20, 32, 29, 38]}
      outcomes={[
        { id: "celtics", label: "Celtics", probability: 0.51, color: "#34d399" },
        { id: "lakers", label: "Lakers", probability: 0.49, color: "#fbbf24" },
      ]}
      onOutcomeClick={onTrade}
    />
  );
}

Install

Add it with the shadcn CLI, or copy the source manually.

$ bunx --bun shadcn add @beui/prediction-market-card

API Reference

title
string

Market question shown as the card heading.

Default—
icon?
ReactNode

Image or icon shown in a round frame beside the title.

Default—
category?
string

Category label shown under the title, after the status.

Default—
volume
string

Preformatted trading volume shown in the footer, e.g. "$2.4M".

Default—
volumeHistory?
number[]

Chronological volume samples for the optional footer sparkline.

Default—
status?
string

A scheduled time or live match status.

Default—
live?
boolean

Show the status in red with a dot, for a match in progress. Default: false

Defaultfalse
outcomes
PredictionMarketCardOutcome[]

Outcomes listed with their probability, payout and trade button.

Default—
onOutcomeClick?
((value: PredictionMarketCardSelection) => void)

Called on each outcome CTA click; the card keeps no selected state.

Default—
bookmarked?
boolean

Whether the market is bookmarked, for controlled use.

Default—
defaultBookmarked?
boolean

The initial bookmark state when uncontrolled. Default: false

Defaultfalse
onBookmarkChange?
((bookmarked: boolean) => void)

Called with the new state when the bookmark button is pressed.

Default—
labels?
Partial<{ payoutHint: string; payoutFor: string; volume: string; bookmark: string; trade: string; percent: string; yes: string; no: string; }>

Override any built-in string.

Default—
className?
string

Classes merged onto the root element.

Default—

More in Prediction Market

Keep in mind

Some components on this site are inspired by or recreated from existing work across the web. I'm not here to take credit; just to learn, experiment, and sometimes push things a bit further. If something looks familiar and I forgot to mention you, reach out and I'll fix that right away.

Updated