Odds Selector
mrdoge-ui/odds-selectorFreeComponent
Labeled odds card for a market: selectable options with price movement and suspended states.
Install it
npx shadcn@latest add https://mrdoge.co/r/odds-selector.jsonSource
1"use client"23import { useState } from "react"4import { ChevronDown, LayoutGrid, SlidersHorizontal } from "lucide-react"5import { cn } from "@/lib/utils"6import { Button } from "@/components/ui/button"78export type OddsMovement = "up" | "down" | "flat"910export interface OddsOption {11 id: string12 /** Selection label, e.g. "1", "X", "2" or a team name / "Draw". */13 label: string14 /** Formatted price, e.g. "1.85". */15 price: string16 movement?: OddsMovement17 suspended?: boolean18}1920/**21 * One market rendered as a two-column row, e.g. Over/Under at a single22 * goal threshold. Use `lines` (a market per row) instead of `options` (a23 * flat row of a single market) for bet types that post one market per24 * line: see the "Multiple Lines" example.25 */26export interface OddsLine {27 id: string28 /** Short label for the line itself, e.g. "2.5". Shown above the slider in slider view. Omit if there's no natural short label. */29 label?: string30 over: OddsOption31 under: OddsOption32}3334export interface OddsSelectorProps {35 /** Market name shown as a header above the options, e.g. "Match Result". Omit to render just the options. */36 label?: string37 /** A single market's selections, laid out in one row. Ignored when `lines` is set. */38 options?: OddsOption[]39 /** Id of the currently selected option, for `options` mode. */40 selectedId?: string41 /** Called with the pressed option's id, or `undefined` when pressing the already-selected option deselects it. For `options` mode. */42 onSelect?: (id: string | undefined) => void43 /** Several markets, one per row, e.g. every Over/Under goal threshold stacked in one card. Takes over `options` when set. */44 lines?: OddsLine[]45 /** Ids of every currently selected option across `lines`. Unlike `options`, more than one row can be selected at once. */46 selectedLineIds?: string[]47 /** Called with a pressed option's id and the resulting selected state (not a bare toggle), for `lines` mode. */48 onSelectLine?: (id: string, selected: boolean) => void49 /**50 * Ids that render as unavailable, e.g. because they're logically51 * incompatible with the current selection. Applies to both `options`52 * and `lines`. Computed externally (e.g. via a conflict adapter) and53 * passed in; OddsSelector never decides this itself. Unlike54 * `suspended`, a disabled option still shows its real price: it's55 * fully priced and available, just not currently combinable.56 */57 disabledIds?: string[]58// … truncated
What it pulls in
Other registry items
Files it writes
More from mrdoge-ui
All 26 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Bet Slipbet-slip | mrdoge-ui | Components | Free | no deps | |
| Entity Imageentity-image | mrdoge-ui | Components | Free | no deps | |
| Match Cardmatch-card | mrdoge-ui | Components | Free | no deps · 3 files | |
| Match Card Compactmatch-card-compact | mrdoge-ui | Components | Free | no deps | |
| Match Highlightmatch-highlight | mrdoge-ui | Components | Free | no deps · 2 files | |
| Match Timelinematch-timeline | mrdoge-ui | Components | Free | no deps | |
| Stats Liststats-list | mrdoge-ui | Components | Free | no deps |
