Bridge Training
Bridge ReactPlay

PlayEditor

Value/onChange-driven play editor with interactive card selection.

Import from @workspace/bridge-react/play/editors/play-editor.

Overview

PlayEditor is a self-contained play editor with dual rendering modes. In edit mode it uses PlayInputs for interactive card selection; in read-only mode it renders TricksDisplay.

import { PlayEditor } from '@workspace/bridge-react/play/editors/play-editor';

<PlayEditor
  hands={hands}
  tricks={tricks}
  declarer="S"
  auctionSequence={auction.sequence}
  onTricksChange={setTricks}
  comments={comments}
  onCommentsChange={setComments}
/>

Dual Mode

ModeConditionRenders
EditreadOnly is falsyPlayInputs — interactive card selection grid
Read-onlyreadOnly={true}TricksDisplay — static trick table
// Read-only mode
<PlayEditor
  hands={hands}
  tricks={tricks}
  auctionSequence={auctionSequence}
  readOnly
/>

Lead Player Derivation

The opening lead player is derived automatically from the declarer prop — it's the player to the left of declarer. If no declarer is provided, defaults to West.

Comments

Play comments can be managed externally via comments/onCommentsChange, or the editor manages them internally if those props are omitted.

Props

Prop

Type

Notes

  • Wrapped with withBridgeContext — can be used outside a BridgeProvider
  • auctionSequence is passed to PlayInputs for trump suit derivation

On this page