Skip to Content
react-brackets

Results

Report scores, stream live matches, and undo results. Winners move forward on their own.

Quarterfinals

  1. Falcons
    Cobras
  2. Lynx
    Orcas
  3. Wolves
    Bison
  4. Herons
    Ravens

Semifinals

  1. TBD
    TBD
  2. TBD
    TBD

Final

  1. TBD
    TBD

Third place

  1. TBD
    TBD

Stages are immutable. Every update returns a new stage, so they drop straight into useState, a store, or a server response.

import { reportResult, resetResult } from 'react-brackets';

const [stage, setStage] = useState(() => singleElimination(teams));

// a finished match: the higher score wins and moves on
setStage((s) => reportResult(s, 'main.r1.m1', { scores: [3, 1] }));

// a live match: scores show, nobody advances yet
setStage((s) => reportResult(s, 'main.r1.m2', { scores: [1, 1], live: true }));

// a tie in a knockout needs an explicit winner
setStage((s) => reportResult(s, 'main.r1.m2', { scores: [2, 2], winner: 1 }));

// undo, which also clears everything that depended on it
setStage((s) => resetResult(s, 'main.r1.m1'));

Match status

StatusMeaning
waitingAt least one side is still to be decided.
readyBoth sides are known.
liveReported with live: true.
completedFinished. A bye completes on its own.
skippedWill never be played, like an unused bracket reset.

Overturning a result clears every result downstream of it, so a stage can't hold a winner who never qualified.

Saving stages

A stage is JSON. Store it, send it, and render it anywhere:

await db.save(JSON.stringify(stage));
const stage = JSON.parse(saved) as Stage;

On this page