Bracket
Tournament bracket renderer supporting single-elimination, double-elimination and round-robin layouts with SVG connector paths.
Preview
Rendering the live preview…
single-eliminationRendering the live preview…
round-robinRendering the live preview…
with scoresStructure
Anatomy
Visual breakdown of the component's internal structure with BEM class call-outs.
<origam-bracket> — 5 parts: root container ①, round column ②, match card ③, SVG connector paths ④, competitor row ⑤.- 1.origam-bracket
- Root element. role="region" with aria-label. Scrollable overflow:auto for wide brackets.
- 2.origam-bracket__rounds
- Flex row (horizontal) or column (vertical) containing all round columns.
- 3.origam-bracket__match
- Individual match card rendered by OrigamBracketMatch. Has hover state and focus ring when interactive=true.
- 4.origam-bracket__connectors
- SVG overlay drawing connector paths between match cards. aria-hidden, positioned absolutely.
- 5.origam-bracket__competitor
- Competitor row rendered by OrigamBracketCompetitor. Carries winner/loser/pending state classes.
API
Props
All props accepted by this component, with their type, default value and description.
- roundsrequiredIBracketRound[]
- Required. Pre-ordered list of rounds. Each round has an id, title, matches array and optional side marker for double-elimination.
- Tournament shape: "single-elimination" renders a tree, "double-elimination" adds a losers bracket, "round-robin" renders an NxN results matrix.
- direction'horizontal' | 'vertical''horizontal'
- Layout axis. Horizontal stacks rounds as columns (classic tree). Vertical stacks rounds as rows. Ignored for round-robin.
- showRoundTitlesbooleantrue
- Toggle round header labels (e.g. "Quarter-finals") above each round column.
- showScoresbooleantrue
- Toggle the score column on each competitor row.
- showSeedbooleanfalse
- Render a seed number prefix before competitor names (e.g. "1. Team Liquid").
- interactivebooleantrue
- When true, match cards show cursor affordance, hover state and keyboard focus. Click handlers still fire when false.
- winnersLabelstring'Winners bracket'
- Heading above the winners bracket tree in double-elimination mode. Pre-translate before passing.
- losersLabelstring'Losers bracket'
- Heading above the losers bracket tree in double-elimination mode. Pre-translate before passing.
- idstring
- classstring | Array<string> | object
- stylestring | Array<string> | object | StyleValue
- tagstring'div'
- HTML element rendered at the root. role="region" is always set.
- Density modifier affecting gaps and match card sizing.
- Border-radius token or boolean.
- roundedTopRightboolean | number | string
- roundedTopLeftboolean | number | string
- roundedBottomLeftboolean | number | string
- roundedBottomRightboolean | number | string
- color
- Intent or custom foreground color.
- bgColor
- Background color of the bracket surface.
- borderboolean | number | string | TDirectionBoth | Array<TDirectionBoth>false
- Applies a border to the bracket container.
- borderColorstring
- borderTopboolean | number | string
- borderLeftboolean | number | string
- borderBottomboolean | number | string
- borderRightboolean | number | string
- borderBlockboolean | number | string
- borderInlineboolean | number | string
- borderBlockStartboolean | number | string
- borderBlockEndboolean | number | string
- borderStylestring
- borderTopColorTColor
- borderRightColorTColor
- borderBottomColorTColor
- borderLeftColorTColor
- borderBlockStartColorTColor
- borderBlockEndColorTColor
- heightnumber | string
- Bracket container height.
- maxHeightnumber | string
- maxWidthnumber | string
- minHeightnumber | string
- minWidthnumber | string
- widthnumber | string
- Bracket container width.
- elevationTElevation
- Box-shadow elevation token.
- marginboolean | number | string
- marginTopboolean | number | string
- marginLeftboolean | number | string
- marginBottomboolean | number | string
- marginRightboolean | number | string
- marginBlockboolean | number | string
- marginInlineboolean | number | string
- marginInlineStartboolean | number | string
- marginInlineEndboolean | number | string
- marginBlockStartboolean | number | string
- marginBlockEndboolean | number | string
- paddingboolean | number | string
- paddingTopboolean | number | string
- paddingLeftboolean | number | string
- paddingBottomboolean | number | string
- paddingRightboolean | number | string
- paddingBlockboolean | number | string
- paddingInlineboolean | number | string
- paddingInlineStartboolean | number | string
- paddingInlineEndboolean | number | string
- paddingBlockStartboolean | number | string
- paddingBlockEndboolean | number | string
- fontSizeTFontSize
- fontWeightTFontWeight
- letterSpacingTLetterSpacing
API
Slots
Content slots exposed by this component.
- #connector
- Override SVG connector path elements drawn between match cards.
- #round-title
- Override the round title header above each column.
- #match
- Override any match card rendering. Receives the full match descriptor and its parent round.
- #competitor
- Override any competitor row inside a match card.
API
Emits
Events emitted by this component.
- @match-clickIBracketMatch, IBracketRound, MouseEvent
- Fired when the user clicks a match card. Payload: the match, its parent round and the DOM event.
- @winner-clickIBracketCompetitor, IBracketMatch, MouseEvent | KeyboardEvent
- Fired when the user clicks a competitor marked as winner.
- @competitor-clickIBracketCompetitor, IBracketMatch, MouseEvent | KeyboardEvent
- Fired when the user clicks any competitor row in a match.
- @round-robin-cell-clickIBracketCompetitor, IBracketCompetitor, MouseEvent
- Fired when the user clicks a round-robin result cell. Payload: row competitor, column competitor, DOM event.
API
Exposed members
Properties and methods accessible via template ref (defineExpose). Use them for programmatic control.
- <T extends object>(props: T, exclude?: string[]) => Partial<T>
- Utility to forward a filtered subset of props to child components.
- ComputedRef<IBracketRound[]>
- Processed rounds array after normalization (sorted, side-grouped for double-elimination).
- ComputedRef<Array<{ key: string; d: string }>>
- Computed SVG path data for connector lines between match cards.
- ComputedRef<IBracketCompetitor[]>
- Flattened unique competitor list extracted from all rounds (round-robin matrix axes).
Customisation
CSS variables
CSS custom properties exposed by this component. Override them to customise the component without losing theme compatibility.
- Default text color.
- Bracket container background.
- Gap between round columns.
- Default match card width.
- Match card background.
- Match card border-radius.
- Competitor row height.
- Background of the winning competitor row.
Inclusion
Accessibility
ARIA roles, keyboard navigation and focus management. Sourced from the real component template.
ARIA roles
Keyboard interactions
| Key | Action |
|---|---|
| Tab | Moves focus between interactive match cards when interactive=true. |
| Enter / Space | Fires the match-click emit on the focused match card. |
Notes
- The root element has role="region" and aria-label from the prop for a clear landmark.
- Round-robin mode uses role="table" / role="row" / role="cell" / role="rowheader" / role="columnheader" for full grid semantics.
- SVG connector paths are aria-hidden — purely decorative.
- When interactive=true, match cards receive focus-visible ring styling for keyboard navigation.
Interactive
Playground
Edit props live and see the component update in real time. The generated code snippet updates as you change values.
Rendering the live preview…
Usage
Examples
Ready-to-paste code snippets for your templates.
Single-elimination bracket
Round-robin matrix
Custom match slot
Ecosystem
Family
Components from the same folder that share conventions and often compose together.
BracketRound
Renders a single round column (or row in vertical mode) containing its OrigamBracketMatch cards.
BracketMatch
A single match card showing two OrigamBracketCompetitor rows with optional scores.
BracketCompetitor
One competitor row inside a match card: avatar, seed, name and score. Carries winner/loser/pending state.