Knockout Wheel

knockout-wheel.tsx

Install

$ bunx --bun shadcn add @beui/knockout-wheel

API Reference

rounds
Round[]

The whole draw, ordered widest round first — the same array the knockout bracket takes. Any single-elimination tournament fits: each round holds half the matches of the one before it (16 → 8 → 4 → 2 → 1) and `rounds[r].matches[k]` is fed by matches `2k` and `2k + 1` of the round before it. Two rounds are enough; the wheel grows a ring per round and sizes itself to the rim.

Default—
initialRound?
number

Index of the outermost round to draw. Earlier rounds are dropped and the kept round's own teams become the rim, so `1` on a 32-team draw opens at the Round of 16. Defaults to 0 (the whole tree); clamped to the valid range.

Default0
className?
string
Default—
labels?
Partial<{ label: string; labelWithChampion: string; tbd: string; versus: string; result: string; resultPenalties: string; caption: string; }>

Override any built-in string.

Default—

Knockout Bracket

knockout-bracket.tsx

Install

$ bunx --bun shadcn add @beui/knockout-bracket

API Reference

rounds
Round[]

The whole draw, ordered widest round first. Any single-elimination tournament fits: each round holds half the matches of the one before it (16 → 8 → 4 → 2 → 1) and `rounds[r].matches[k]` is fed by matches `2k` and `2k + 1` of the round before it. Two rounds are enough.

Default—
initialRound?
number

Round shown as the leftmost column on mount. Defaults to 1, clamped to the valid range.

Default1
thirdPlace?
Match

Third place play-off, rendered under the bracket instead of inside it.

Default—
thirdPlaceLabel?
string

Heading over `thirdPlace`. Defaults to the `thirdPlace` message ("Third place play-off").

Default—
labels?
Partial<{ label: string; previousRound: string; nextRound: string; showing: string; thirdPlace: string; tbd: string; fullTime: string; fullTimePenalties: string; sideScore: string; sideScorePenalties: string; matchResult: string; matchVersus: string; winner: string; }>

Override any built-in string.

Default—
className?
string
Default—

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