Bracket
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-eliminationRendu de l’aperçu en cours…
round-robinRendu de l’aperçu en cours…
with scoresStructure
Anatomie
Décomposition visuelle de la structure interne du composant avec les appels de classes BEM.
<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.
- roundsrequisIBracketRound[]
- 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
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-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
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
Interactions clavier
| Touche | 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.
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
Round-robin matrix
Custom match slot
Écosystème
Famille
Composants du même dossier qui partagent les conventions et se composent souvent ensemble.
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.