Prediction Market
Prediction Market presents supplied outcomes, local order values and callbacks.
Practical React example
Prototype an outcome-selection and order-entry surface using clearly labelled demonstration prices.
Before you copy and paste
Keep the example in the React rendering environment required by the imported component. Copy components/motion/prediction-market.tsx and its returned support files from the Code tab; preserve the project-relative paths.
Listed package dependencies: clsx, lucide-react, motion, react, tailwind-merge.
Use the Code tab for the component files and installation instructions, then adapt the imports in this example to your project.
Prototype an outcome-selection and order-entry surface using clearly labelled demonstration prices
// Usage adapted from beUI's pinned MIT source.
// Copyright (c) 2026 Saurabh Chauhan. See ./LICENSES.md.
"use client";
import { useState } from "react";
import {
PredictionMarket,
type PredictionMarketOrderValue,
} from "@/components/motion/prediction-market";
const outcomes = [
{
id: "yes",
label: "Yes",
price: 0.167,
},
{
id: "no",
label: "No",
price: 0.834,
},
];
export function PredictionMarketPreview() {
const [order, setOrder] = useState<PredictionMarketOrderValue>({
mode: "buy",
outcomeId: "yes",
amount: "115",
});
return (
<div className="flex w-full items-center justify-center">
<PredictionMarket
outcomes={outcomes}
value={order}
onValueChange={setOrder}
balance={500}
positions={{ yes: 125, no: 48 }}
quickAmounts={[1, 5, 10, 100]}
/>
</div>
);
}
Usage example adapted from beUI's pinned MIT source. Retain the source licence notices when copying.
Replace demo balances and prices with authoritative data before integrating a trading workflow. Treat onTrade as intent requiring independent validation and execution.
Customization
- PredictionMarketProps.outcomes
- Optional; PredictionMarketOutcome[].
- PredictionMarketProps.value
- Optional; PredictionMarketOrderValue.
- PredictionMarketProps.defaultValue
- Optional; Partial<PredictionMarketOrderValue>.
- PredictionMarketProps.onValueChange
- Optional; (value: PredictionMarketOrderValue) => void.
- PredictionMarketProps.onTrade
- Optional; ( order: PredictionMarketOrderValue, quote: PredictionMarketQuote, ) => void.
- PredictionMarketProps.onSignIn
- Optional; () => void.
- PredictionMarketProps.authenticated
- Optional; boolean.
- PredictionMarketProps.orderTypeLabel
- Optional; string.
- PredictionMarketProps.balance
- Optional; number.
- PredictionMarketProps.positions
- Optional; Record<string, number>.
- PredictionMarketProps.quickAmounts
- Optional; number[].
- PredictionMarketProps.minTrade
- Optional; number.
- PredictionMarketProps.className
- Optional; string.
- PredictionMarketProps.classNames
- Optional; PredictionMarketClassNames.
Integration notes
- The component does not execute or settle an order, establish eligibility or guarantee a payout.
- Do not present a sample quote or a client authenticated flag as a real trading authorization.
Component source: beUI documentation . These examples describe the version imported into Rendyn. Upstream APIs may have changed; retain the source licence notices when adapting the code.
Give your agent taste.
The best way to use Rendyn is through MCP. Let your agent find the right component, compare previews and bring the source into your project.
All components are free. Sign up only to connect MCP.