Hooks and types
Hooks for custom parts, and the types you'll use with the components.
useBracket
function useBracket(): BracketContextValueEverything about the bracket being drawn. Call it in any component inside Bracket.Root, for example to build your own navigation:
function RoundPicker() {
const { rounds, page, setPage } = useBracket();
return (
<select value={page} onChange={(event) => setPage(Number(event.target.value))}>
{rounds.map((round, index) => (
<option key={round.id} value={index}>{round.name}</option>
))}
</select>
);
}Prop
Type
useBracketCell
function useBracketCell(): LayoutCellThe match being rendered and where it sits, inside Bracket.Matches. Returns a LayoutCell.
useConnector
function useConnector(): ConnectorStateThe line being rendered, inside Bracket.Connectors. Use it to keep a custom line in its own component. Returns a ConnectorState.
Labels
Prop
Type
Motion
Prop
Type
RootState
Prop
Type
RoundState
Prop
Type
MatchState
Prop
Type
ParticipantState
Prop
Type
ConnectorState
Prop
Type
Column
Prop
Type
ClassNames
A class for any part, by name:
type ClassNames = Partial<Record<Part, string>>;Part is one of root, group-title, viewport, content, round, round-title, matches, cell, match, participant, participant-name, participant-score, connectors, connector, pagination, page, page-previous, page-next, zoom-controls, zoom-in, zoom-out and zoom-reset. See Parts and data attributes for what each one is.