🎮 Beta Gamer

Shared components

These components work across all games. In React they accept className for styling; in React Native they accept style / textStyle.

PlayerCard

Displays a player's avatar, display name, and an active-turn indicator.

PropTypeRequiredDescription
player"self" | "opponent"YesWhich player to display
classNamestringNoExtra CSS classes (React only)
styleViewStyleNoContainer style (React Native only)
nameStyleTextStyleNoName text style (React Native only)
import { PlayerCard } from '@beta-gamer/react';

// Shows opponent's name + active-turn highlight when it's their turn
<PlayerCard player="opponent" className="mb-2" />

// Shows your own name
<PlayerCard player="self" className="mt-2" />

Timer

A live countdown clock that syncs with the server. Counts down only when it's that player's turn. Turns red below 30 seconds.

PropTypeRequiredDescription
player"self" | "opponent"YesWhich player's clock to show
initialSecondsnumberNoStarting value in seconds. Defaults to the session clock (600 for chess).
classNamestringNoExtra CSS classes (React only)
styleViewStyleNoContainer style (React Native only)
textStyleTextStyleNoClock text style (React Native only)
import { Timer } from '@beta-gamer/react';

<Timer player="opponent" className="text-lg font-mono" />
<Timer player="self"     className="text-lg font-mono" />

// Override starting time (e.g. 5-minute game)
<Timer player="self" initialSeconds={300} />
⚠️ The Timer syncs from timer:update socket events. If you're using useSocket() to listen to events manually, avoid also rendering a Timer for the same player — they'll conflict.
Beta Gamer GaaS API — questions? support@beta-gamer.com