Bridge Training
UI Bridge

Player

Atoms for displaying a player position or side.

Import from @workspace/ui-bridge/player/*.

Selection components live on the Player selector page.

PlayerDisplay

A player position as its translated label (default), its compass icon, or both. notation="short" shows the initial instead of the name; an ancestor carrying data-player-notation="short" forces the initial on every label below it, so a layout can switch its labels without threading a prop. The needle points at the position; activeColor and inactiveColor take any CSS color.

import { PlayerDisplay } from '@workspace/ui-bridge/player/player-display';

<PlayerDisplay player="N" />
<PlayerDisplay player="S" variant="icon" />
<PlayerDisplay player="E" variant="icon+label" inactiveColor="var(--color-muted-foreground)" />
<PlayerDisplay player="W" notation="short" />  {/* "W" */}
<div data-player-notation="short"><PlayerDisplay player="E" /></div>  {/* "E" */}

light

icon

label

NorthEastSouthWest

icon+label

NorthEastSouthWest

icon+label · French

NordEstSudOuest

notation · short

NESW

ancestor data-player-notation=short

NorthEastSouthWest

icon · muted ring

dark

icon

label

NorthEastSouthWest

icon+label

NorthEastSouthWest

icon+label · French

NordEstSudOuest

notation · short

NESW

ancestor data-player-notation=short

NorthEastSouthWest

icon · muted ring

Props

Prop

Type

PlayerTeamDisplay

A partnership (NS / EW, or the legacy attack / defense side) as its label, its four-seat icon, or both (default). Renders nothing for an unknown team. colorize tints the label with the team color; variant="pill" is icon + label in a softly rounded chip with a faint fill of that color (purple for NS, orange for EW).

import { PlayerTeamDisplay } from '@workspace/ui-bridge/player/player-team-display';

<PlayerTeamDisplay team="NS" />
<PlayerTeamDisplay team="defense" variant="label" colorize />
<PlayerTeamDisplay team="EW" variant="pill" />

light

icon

label

AttackDefense

icon+label

AttackDefense

pill

AttackDefense

label · colorize

AttackDefense

dark

icon

label

AttackDefense

icon+label

AttackDefense

pill

AttackDefense

label · colorize

AttackDefense

Props

Prop

Type

Utilities

ExportDescription
DEFAULT_PLAYER_SIDE_COLORS{ NS: 'var(--color-player-side-ns)', EW: 'var(--color-player-side-ew)' }
getPlayerSideColor(player)Returns the side color for a player position
TEAMS['NS', 'EW']