Bracket

Data Display
stable

Tournament bracket renderer supporting single-elimination, double-elimination and round-robin layouts with SVG connector paths.

Aperçu

Rendu de l’aperçu en cours…

single-elimination

Rendu de l’aperçu en cours…

round-robin

Rendu de l’aperçu en cours…

with scores

Structure

Anatomie

Décomposition visuelle de la structure interne du composant avec les appels de classes BEM.

Anatomy of OrigamBracketSchematic of the Bracket component with 5 numbered internal parts. Round 1 Semi-finals Final 1 2 3 4 5
Anatomy of <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

Toutes les props acceptées par ce composant, avec leur type, valeur par défaut et description.

rounds
requis
IBracketRound[]
Required. Pre-ordered list of rounds. Each round has an id, title, matches array and optional side marker for double-elimination.
variant
'single-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.
showRoundTitles
boolean
true
Toggle round header labels (e.g. "Quarter-finals") above each round column.
showScores
boolean
true
Toggle the score column on each competitor row.
showSeed
boolean
false
Render a seed number prefix before competitor names (e.g. "1. Team Liquid").
interactive
boolean
true
When true, match cards show cursor affordance, hover state and keyboard focus. Click handlers still fire when false.
winnersLabel
string
'Winners bracket'
Heading above the winners bracket tree in double-elimination mode. Pre-translate before passing.
losersLabel
string
'Losers bracket'
Heading above the losers bracket tree in double-elimination mode. Pre-translate before passing.
id
string
class
string | Array<string> | object
style
string | Array<string> | object | StyleValue
tag
string
'div'
HTML element rendered at the root. role="region" is always set.
density
'default'
Density modifier affecting gaps and match card sizing.
Border-radius token or boolean.
roundedTopRight
boolean | number | string
roundedTopLeft
boolean | number | string
roundedBottomLeft
boolean | number | string
roundedBottomRight
boolean | number | string
color
Intent or custom foreground color.
bgColor
Background color of the bracket surface.
border
boolean | number | string | TDirectionBoth | Array<TDirectionBoth>
false
Applies a border to the bracket container.
borderColor
string
borderTop
boolean | number | string
borderLeft
boolean | number | string
borderBottom
boolean | number | string
borderRight
boolean | number | string
borderBlock
boolean | number | string
borderInline
boolean | number | string
borderBlockStart
boolean | number | string
borderBlockEnd
boolean | number | string
borderStyle
string
borderTopColor
TColor
borderRightColor
TColor
borderBottomColor
TColor
borderLeftColor
TColor
borderBlockStartColor
TColor
borderBlockEndColor
TColor
height
number | string
Bracket container height.
maxHeight
number | string
maxWidth
number | string
minHeight
number | string
minWidth
number | string
width
number | string
Bracket container width.
elevation
TElevation
Box-shadow elevation token.
margin
boolean | number | string
marginTop
boolean | number | string
marginLeft
boolean | number | string
marginBottom
boolean | number | string
marginRight
boolean | number | string
marginBlock
boolean | number | string
marginInline
boolean | number | string
marginInlineStart
boolean | number | string
marginInlineEnd
boolean | number | string
marginBlockStart
boolean | number | string
marginBlockEnd
boolean | number | string
padding
boolean | number | string
paddingTop
boolean | number | string
paddingLeft
boolean | number | string
paddingBottom
boolean | number | string
paddingRight
boolean | number | string
paddingBlock
boolean | number | string
paddingInline
boolean | number | string
paddingInlineStart
boolean | number | string
paddingInlineEnd
boolean | number | string
paddingBlockStart
boolean | number | string
paddingBlockEnd
boolean | number | string
fontSize
TFontSize
fontWeight
TFontWeight
letterSpacing
TLetterSpacing

API

Slots

Emplacements de contenu exposés par ce composant.

#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

Événements émis par ce composant.

@match-click
IBracketMatch, IBracketRound, MouseEvent
Fired when the user clicks a match card. Payload: the match, its parent round and the DOM event.
@winner-click
IBracketCompetitor, IBracketMatch, MouseEvent | KeyboardEvent
Fired when the user clicks a competitor marked as winner.
@competitor-click
IBracketCompetitor, IBracketMatch, MouseEvent | KeyboardEvent
Fired when the user clicks any competitor row in a match.
@round-robin-cell-click
IBracketCompetitor, IBracketCompetitor, MouseEvent
Fired when the user clicks a round-robin result cell. Payload: row competitor, column competitor, DOM event.

API

Membres exposés

Propriétés et méthodes accessibles via ref template (defineExpose). Utilisés pour le contrôle programmatique.

<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).

Personnalisation

Variables CSS

Propriétés CSS personnalisées exposées par ce composant. Surchargez-les pour personnaliser sans perdre la compatibilité avec le thème.

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

Accessibilité

Rôles ARIA, navigation clavier et gestion du focus. Sourcé depuis le template réel du composant.

Rôles ARIA

region
table
row
cell
rowheader
columnheader
gridcell

Interactions clavier

Interactions clavier
ToucheAction
TabMoves focus between interactive match cards when interactive=true.
Enter / SpaceFires 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.

Interactif

Playground

Modifiez les props en direct et observez le composant se mettre à jour. Le snippet de code généré suit vos changements.

Rendu de l’aperçu en cours…

Usage

Exemples

Extraits de code prêts à coller dans vos templates.

Single-elimination bracket

vue

Round-robin matrix

vue

Custom match slot

vue

Écosystème

Famille

Composants du même dossier qui partagent les conventions et se composent souvent ensemble.