The adapter (
client/src/core/theme/sdk/table/) runs both table pages, the standard layout emits the DOM contract, skins apply, and a theme layout mounts on tables whose style names it once it is certified or an admin enables it. Not supported: per-table theme inheritance (a table style’sthemeSlug); every table uses the active theme.
A layout is a theme component that draws the poker table. It reads a TableView the host builds, and it sends player intents through one function, act(). Everything that decides what happens in a hand stays in product code. This page draws that line.
The standard layout
The table renderer the product ships today is the standard layout inside default. It is the only renderer that emits the DOM contract and accepts theme skins, and it is the default for new table styles. Its components live in client/src/components/game/table/, with Table* names and .tbl-* classes, and the table-style editor offers it as Standard. Style it through data-pe attributes, the contract, rather than through its classes.
A theme layout is an alternative that renders from the same TableView. A layout’s capability manifest declares the seat counts, variants and modes it supports; tables outside that set render standard.
When a theme layout mounts
TableThemeBoundary (both table pages) mounts a theme layout instead of standard only when all of these hold:
- The table’s style names the layout (
layoutId, Table layout in the Table Style editor). Empty,nullandstandardare the standard layout. - The server lists the layout as mountable for the theme that provides it.
GET /api/v1/config/themereturnsmountableLayouts: [{ id, theme, verified }], and the server lists a layout when that theme’s stored certification record verifies or an admin enabled it for the installed files (src/themes/certification.ts; see Testing and Certification). The client never decides this itself. In a child theme, a child that redeclares a parent’s layout needs its own record or decision. - The theme’s registration for that id is the one the chain resolves (child first), and the table is inside its declared seat counts, variants and modes.
Otherwise the table renders standard, with the theme’s tokens and skin. The layout renders inside the adapter’s host context (view models and act() only) and inside the theme error boundary, with standard as the fallback. Activation, upgrade, rollback and deactivation reach open tables through appearance_updated: the loader fetches the configuration again and the registry takes the server’s new list, so rolling back to a version that is not mountable stops the layout mounting at once, without a reload.
standard is reserved. The validator refuses a standard layout in theme.json (manifest.layout-id), and the runtime registry refuses a bundle whose defineTheme registers layouts.standard: the whole theme is refused and default stays active, so a theme can never replace the standard layout uncertified.
Game information the host draws over a theme layout
A theme layout replaces the host table page, so the host draws three things over every theme layout itself, with no theme change: the Rules link (opens the game rules in a new tab; the table and the seat stay), the Play money marker at a play-chip table (a play-chip tournament’s tables included) and the Win odds on notice while the table shows win odds. They sit in one small cluster in the theme’s colours (--th-surface, --th-border, --th-text, --th-accent, --th-accent-text, --th-yellow-400).
Two forms. The full form is the labelled cluster: Play money (yellow), Win odds on (a button that opens the notice) and Rules. The compact form is one round 28 px button (data-testid="table-host-info-toggle") named "Game information" ("Game information: play money" at a play-money table, in its accessible name and tooltip), with a yellow dot inside it at a play-money table so play money is still marked at a glance; it opens a panel listing the same three items, closed by default, that closes on Escape, a tap outside and the next deal. The cluster carries data-form="full" or data-form="compact".
Placement rule: the full form takes the first of bottom start, top start, middle start, middle end, bottom end and top end (in a row, then with the items stacked in a column, data-stacked), then the first clear spot along the start and end edges, the bottom and top edges and a coarse grid (data-slot="free", a measured position), whose box covers none of the layout’s data-pe nodes board, community-cards, pot, seat, action, controls, top-bar, chat and win-odds, nor the host’s Show my cards button (streamer mode), nor the layout’s live text, logs and controls (elements with aria-live or the status, log or alert role, such as a "you are watching" line, and buttons, links, form fields and tabs; visually hidden ones do not count; give a status line one of those roles so the game information keeps clear of it). When no placement of the full form is clear, the compact button searches the same placements; a single small button finds a clear spot on any real layout. Then both tries again against the data-pe nodes and the Show my cards button alone; only a layout with no clear 28 px spot anywhere gets the compact button where it covers the least. It is worked out again, before the next paint, when the window or the layout’s size changes, when the layout adds or removes elements or changes a class, style, hidden, data-mode or data-pe-count attribute, when one of the nodes it avoids resizes (the board once cards are dealt), when the cluster’s own size changes (a figure that arrives late, a font that loads) and when the fonts have loaded; it never rests over a node it avoids, and a form it would refuse is never painted. A balance figure still being read (a wallet of another currency) counts at a reserved width (BALANCE_RESERVE, 132 px) rather than as nothing. Small viewports (shorter side below 500 px, a phone in either orientation): the cluster carries only the glance items (play-money marker, win-odds notice, rules link); the detail items (rake rule, balance, last hand, session clock, tournament information) live in the compact form’s panel, so whenever one of them is present (a signed-in player, a raked table) the game information takes the compact form (hostInfoFullFormAllowed). The game information is a named region (section, "Game information"). The certification harness measures it at every step and viewport (in the compact form it opens the panel with a real click to check the rules link) and fails the layout when it covers one of those nodes, so leave at least a 28 px gap somewhere on screen; leave room for the full form if you want the labels visible. Do not draw a second rules link or play-money marker in the layout. Tournament information: at a tournament table with a level clock the host adds a pill to the cluster with the level and the time to the next level (Lv 3 · 04:12, a fixed-width figure so the cluster keeps its size) that opens the whole information: the level with its blinds and ante, the next level and its blinds, the time to the next break, players left of the entrants, the average stack, the player’s own place, the next payout (what the next elimination pays, or how many players to the money, with the places paid) and, in a knockout or progressive knockout, the player’s own bounty, in a mystery bounty the prizes left by amount. In the compact form the panel lists all of it; on a small viewport only the panel carries it. It is a list of terms and values (dl), so a screen reader reads each figure with its name. The level and countdowns come from the table state’s level clock (the same reading as the standard top bar’s level pill), the rest from the tournament’s detail, structure and standings routes, read when the information opens and again after the events the table already receives (a hand that ends, a level change, a break, hand-for-hand, a table move, a reconnect). Nothing is drawn at a cash table. A layout needs no change for it.
Passing overlays the host places, and a layout’s own notices (contract 0.2.17)
The host also draws, over every layout (the built-in ones and every theme’s), a few passing overlays: the rabbit-hunt reveal ("Would have come (not dealt)"), the discard picker of the three-card hold’em games and the run it twice panel, and the game information panel opened from its compact button. Each is placed by one rule (client/src/core/theme/sdk/table/overlay-placement.ts): the first spot that covers nothing that matters for play, tried next to what it belongs to (the board for the reveal, the player’s own seat for the discard picker, the button for the panel), then anywhere on the screen; in a smaller form where the larger one has no clear spot (the reveal in smaller cards, then with its label wrapped to the cards’ width; the discard picker narrow, then in one row of cards with the seconds left beside its button, then in two short rows for a corner of free felt; the panel cut shorter in 8px steps, scrolling; a layout’s own marked notice wrapped narrower), a larger form that fits by moving a pixel or two off the placement grid kept before a smaller one; and only when no form has a clear spot, where it covers the least, weighted: never the player’s own seat and cards, the board, the pot, the action controls or the top bar while anything else is possible, an open seat before another player’s seat. A layout needs nothing for this; it only has to mark its seats (data-pe="seat" with data-pe-state and data-pe-hero), their cards (data-pe="seat-cards"), the board, the pot and the controls, as the contract asks.
A layout’s own passing notice (a refused action’s toast, say) may ask for the same rule: mark it data-pe-place="clear". While it is shown, the host leaves it where the layout drew it when that spot covers no seat, and otherwise moves it (position: fixed, its look unchanged; wrapped narrower where that finds a clear spot) to the nearest spot clear of the seats. The attribute is contract 0.2.17; an older host ignores it, so a layout that uses it may keep declaring an older range. Felthouse, Neo and Wildcard UI mark their refused-action notice.
The gameplay boundary
Gameplay, product code, never adjustable by a theme:
- The socket and transport; table state, sequence tracking, idempotency, resync.
- Hand transitions and the runout, transition, cleanup and chip-flight timers.
- Action legality; call and raise amounts; minimum and maximum; fixed-limit and pot-limit maths.
- Timers, time bank, auto-actions, and the queued pre-actions ("check/fold", "call any"), "sit out next hand" and "leave after hand" (contract 0.2.0: the host keeps the queue and sends them; a layout only sets and clears them).
- Sit out, sit in, buy-in, add chips, rebuy, add-on, re-entry.
- Tournament events and pause.
- Showdown order, reveal timing, pot and side-pot data, hi-lo splits.
- Hand strength; seat selection validation.
- Chat delivery and moderation; spectator restrictions.
Presentation, theme code:
- Layout geometry, markup and CSS.
- The presentation timers a layout may declare within ranges the adapter sets: deal and flip reveal, community-card stagger, winner display.
- Sounds mapped to cue ids; artwork.
- The look of the action bar, chat, dialogs, top bar and tournament overlay.
- Reduced-motion and density handling.
Rules that used to live in presentation code now live in the adapter (derive.ts), and the standard layout’s components call them: which cards are visible (canShowSeatCards), the stud face-down rule, best-hand matching, the hole-card count and the hidden-card placeholders, the point-of-view rotation, the seat count, busted derivation and the status precedence (deriveSeatStatusText, deriveSeatState), the local action-clock countdown (useSeatCountdown), the fixed-limit bet-or-raise choice (betOrRaise), the all-in-instead-of-bet rule (shouldShowAllInInsteadOfBet, which also removes bet and raise from ControlsView when only all-in is possible), the hi-lo sums, chat trimming and the 200-character cap (normalizeChatMessage), and who gets controls and chat (hasSeatedControls). A layout rendering from TableView cannot alter them.
How the boundary is enforced
- The validator and scanner reject any reference to the socket, the game store, gameplay events or gameplay routes. See Validation and Scanner Rules.
- At runtime the SDK is the only data path; the socket is never exposed on the host object.
- Certification checks every contract node against the adapter’s value at every step of a recorded session. See Testing and Certification.
- A theme error boundary swaps to
standardinside the same session, without a reload, when a layout throws.
The adapter
The adapter is host code that turns game state into a TableView and validates intents. It lives in client/src/core/theme/sdk/table/ and is mounted by TableHostProvider on both table pages: TablePage calls the socket hook once and hands its command functions to the provider; SpectatorPage mounts the provider without a seat. The provider owns the one usePlayerControls instance behind act(), mounts the sound effects once for the page, mounts through usePlayerControls the player’s own hotkeys (off until the player turns them on in Settings, so the host binds no key by default; a theme that binds keys itself, as Felthouse does for F, C and R, keeps its own), and exposes the hooks below through a React context (useTableHost). While mounted, the provider installs the adapter into the SDK’s table slot (installTableSdk), so useTableView() and friends imported from @pe/sdk read it; off a table page they throw ThemeSdkUnavailableError. The SDK’s hook-free act(intent) reaches the mounted provider. TableThemeBoundary is where a certified theme layout renders from the host’s view models, inside the theme error boundary with the standard markup as the fallback (see When a theme layout mounts).
| Hook | What it returns |
|---|---|
useTableView(tableId) | Table identity, variant, limit, round, phase, seat count, blinds, buy-in range, dealer, hand number, connection state; per seat: stack, bet, folded, all-in, sitting out, waiting, blinds and button, time bank, cards, last action, disconnected; derived: active seat, timer, winners and amounts, best-hand highlight, hi-lo split, pot and side pots, point-of-view rotation; notice: a message the page wants the player to see, already worded for them (why leaving failed, for example), or null. The standard layout shows the page’s own banner; a theme layout should show notice; refusal (contract 0.2.16): { id, message, intent } when the server refused the viewer’s last betting action, time bank, top-up or tournament purchase, worded for them, else null; show message as an alert each time id changes (a refused sit-down or leave is in notice); odds: the viewer’s win odds when the table style turns them on (contract 0.1.1, see Win Odds) |
useControlsView() | The legal actions and amounts, the busted-modal rebuy and re-entry state, and canJoin: whether this page can seat the viewer with join-table. It is false while seated and on the watching page (/tables/:id/watch), which has no seat to offer, so show open-seat buttons only when it is true; on the watching page, link to /table/:id instead. Contract 0.2.0: preAction (the queued pre-action, what may be queued now and the amount faced), sitOutNextHand, leaveAfterHand and topUp ({ available, min, max } for add-chips) |
useChatView() | Messages, muted players, the viewer’s player id, whether chat is enabled |
useTournamentView() | Mode, tournament id, rules, hand-for-hand, mixed game, pause state |
useTableLog() | Contract 0.2.0: the table log, oldest first, up to 200 lines: hand-start (with the blinds), blind, action, board (the street and the cards just dealt), win (amount, hand name, the five winning cards) and chat (muted players left out). Each line is data (TableLogEntry): the layout words it |
useTableHandHistory() | Contract 0.2.0: the hands the viewer played at this table in this session, newest first, up to 20 (TableHandSummary: hole cards, board, won/split/lost/folded, amount won, net, the viewer’s hand name, the winners, the pot). The account’s full history is useHandHistoryController() with commands.setFilters({ tableId }) |
Some fields are null until later work: level, next-level timer, ante, break pending, table move, final table, add-on window, hand strength, showdown order, voided-hand flag, spectator chat permission.
Name the game from gameType, not from variant. Several game types share one layout variant: Razz deals on the stud layout, six-card Omaha on omaha and five-card Omaha hi-lo on omaha-hi-lo. A top bar that names the game from variant calls a Razz table "Seven Card Stud" and a six-card table "Omaha". Read gameType for the name, and give every GameType value its own entry wherever your theme keeps a name, short code or filter list (lobby rows, lobby filters, member pages, home sections): a value without one falls through to a default ("Hold’em", or a cut-off code such as "OMAH"). The bundled themes are checked by tools/theme/product-themes/dom/game-type-names.test.tsx, which reads the GameType enum from the schema, so a new variant fails it until every theme names it.
Six hole cards. Six-card Omaha deals six hole cards to a seat, five-card Omaha hi-lo five. A seat’s fan must stay inside the space five cards take, clear of the name plate, stack, bet and the next seat, face down, face up at showdown and in the hero’s hand. The bundled themes that draw their own seats add an is-six class from six cards (or key a rule on the seat cards’ data-pe-count) and overlap the cards more (tools/theme/product-themes/dom/six-hole-cards.test.tsx); the host’s own table has a [data-card-count="6"] fan of the five-card width.
What a table design needs, and where it is
| Need | Where |
|---|---|
| Pre-actions: check/fold, fold, check, call, call any | controls.preAction and the set-pre-action / clear-pre-action intents (0.2.0, below) |
| Sit out next hand, sit in | sit-out-next-hand / cancel-sit-out-next-hand (0.2.0), controls.sitOutNextHand; sit-out (at once) and sit-in, controls.isSittingOut, controls.canSitIn |
| Sitting back in owing missed blinds: post now or wait | controls.sitInChoice (0.2.16): { postsMissedSmallBlind } when sitting in asks the question (the viewer owes missed blinds and the table lets them post), else null. Ask before sending sit-in with missedBlinds: 'post' or 'wait', worded game.missedBlinds.title, .body, .post and .wait as the standard controls’ dialog |
| Waiting for the big blind, post it now | controls.waitingForBigBlind (0.2.15): { canPost, postsMissedSmallBlind } while a player new to a running cash table (or back owing blinds) waits for the big blind, else null; post-big-blind when canPost. Word it as the standard controls do: game.waitingForBigBlind.status, and game.waitingForBigBlind.post or (with postsMissedSmallBlind) game.missedBlinds.post |
| Add chips, top up | add-chips with controls.topUp.min to controls.topUp.max (0.2.0); the server adds them between hands |
| Leave, leave after this hand | leave-table (at once; the server refuses during a live hand and table.notice says why), leave-after-hand / cancel-leave-after-hand (0.2.0), controls.leaveAfterHand |
| Rebuy after busting | Cash: controls.busted.isOpen and canAddChips with add-chips (between busted.minBuyIn and busted.maxBuyIn); tournaments: busted.rebuy / busted.reentry with tournament-rebuy / tournament-reentry |
| Table log panel | useTableLog() (0.2.0) |
| Recent hands | useTableHandHistory() (0.2.0); full history useHandHistoryController |
| Report a player | reportPlayer({ playerId: seat.playerId, username: seat.username, tableId }) (0.2.1) from an opponent’s seat (not the hero’s); the host opens its report dialog and records the hand in progress. On a hand history row, reportPlayer({ gameId: row.gameId }). A seat control that opens it (for example the name as a role="button") is an interactive contract node, so the certification holds it to the target-size rule (24 css px on each side at every viewport): grow its hit area with padding and an equal negative margin rather than its look, give it an accessible name ("Report <name>") and keep it keyboard-reachable (tabIndex={0}, Enter and Space) |
| Player notes | openPlayerMenu({ playerId, username, tableId }, { x, y }) (0.2.2) from an opponent’s name opens the host’s menu (note and report); editPlayerNote({ playerId, username }) opens the note dialog from a theme’s own player sheet. usePlayerNote(seat.playerId) returns the viewer’s own note (body, color, swatch) or null: draw the colour tag from swatch only when it is set, render body as text, never as HTML. The host loads the notes for a table in one batched request; notes never come over the table socket |
| Per-seat last action | seat.lastActionType (the action) and seat.lastAction (the host’s status word: CALL, ALL IN, SITTING OUT, …) |
| Pots and side pots | table.pot (the total, side pots included), table.sidePots (each { amount, eligibleSeatIndexes }, after the main pot) |
| Winners, their five cards and hand name | table.winners[]: amount, handName, bestCards (0.2.0, Card[]); table.bestHands (strings by seat); seat.isWinner, seat.wonAmount, seat.bestHandCards; table.hiLo for split pots |
| Turn timer and time bank | The active seat’s timer: remaining, total, and (0.2.0) startedAt, endsAt (anchored once per turn on the browser clock, so a CSS countdown does not restart on re-render), usingTimeBank; seat.timeBankRemaining, controls.canUseTimeBank, use-time-bank; the time-warning cue |
| Emotes, gifts, friends | Not table state: a plugin’s data through Using Plugin Data, or its fills in table.seat.badge and table.hud.panel |
act(intent)
One function sends every player action. It validates the intent against the legal actions the server last sent, clamps bet and raise amounts into the legal range, refuses a second identical action while the first is still in flight, and hands the action to the same usePlayerControls path the standard controls use, so the host’s idempotency keys and prompt dedupe are reused as they are. Intents cover: the betting actions, set-bet-amount, sit out, sit in (with the answer to sitInChoice, contract 0.2.16), posting the big blind now (post-big-blind, contract 0.2.15), time bank, add chips (refused when it would take the stack over the maximum buy-in), tournament rebuy, add-on and re-entry, leave, join (seat and buy-in validation), chat, mute and unmute, spectate, and (contract 0.2.0) the queued actions below.
Queued actions (contract 0.2.0)
The host keeps the queue; a layout sets and clears entries and reads them back from useControlsView():
| Intent | Effect |
|---|---|
{ type: 'set-pre-action', preAction } | Queues a pre-action. Accepted only when it is in controls.preAction.available: not on the viewer’s turn, only while they are live in the hand. Facing a bet: check-fold, fold, call, call-any; facing none: check-fold, check, call-any |
{ type: 'clear-pre-action' } | Clears it |
{ type: 'sit-out-next-hand' } | Sits the viewer out when the current hand ends for them (folded, decided, or between hands: then at once) |
{ type: 'cancel-sit-out-next-hand' } | Cancels it |
{ type: 'leave-after-hand', keepWatching? } | Leaves the table (through the page’s own leave handler) once the viewer is out of the hand; at once when they already are |
{ type: 'cancel-leave-after-hand' } | Cancels it |
When the viewer’s turn arrives the host sends the queued pre-action through act() itself, once, after the render that shows the turn:
check-foldchecks when checking is legal, otherwise folds;folddoes the same (the host never folds when checking is free).checkchecks; it is cancelled (nothing sent) as soon as a bet is faced.callcalls exactly the amount faced when it was picked (controls.preAction.callAmount); it is cancelled when that amount changes.call-anycalls whatever is faced, all-in when the call covers the stack and the server offers only all-in, and checks when nothing is faced.- Every pre-action is cleared when it fires, on a new street or hand, when the viewer folds, goes all-in or is out of the hand. Nothing fires, and nothing is cleared, while the connection is down.
A layout shows the pre-action boxes while controls.preAction.available is not empty, marks controls.preAction.selected, and labels them from controls.preAction.facingAmount ("Fold" or "Check / fold").
act() returns { accepted: true } or { accepted: false, reason } with one of not-seated, not-your-turn, illegal-action, amount-out-of-range, chat-disabled, duplicate, unknown-intent. A refused intent sends nothing, exactly as the standard controls refuse the same click silently. On the spectator page every intent but leaving is refused.
Streamer mode (the hero’s hidden cards)
A player can turn on streamer mode, which draws their own hole cards face down on their screen. A theme does nothing for it: while the cards are hidden, the hero’s SeatView has cards: [] and hiddenCardCount set to the number of cards held (private stud cards come with card: null), exactly like an opponent’s seat, so every theme draws backs. The host renders the "Show my cards" button itself and lifts the mask while it or the reveal key is held, after a tap, or once the cards are shown to the table. Win odds are off while the cards are hidden. Actions and hotkeys do not depend on the faces. No contract field was added, so the contract version is unchanged.
Timing profile
useTimingProfile() returns the resolved profile. Gameplay timers are read-only and come from the exported constants of the socket hook, the hand transition and the animation constants: runout street gap and final delay, cleanup, the hand transition (max(showdownDelay − cleanup, 1000) as the server’s showdown delay sets it), the chip flights and the blind post. Presentation timers (hole deal delay, hole flip, hole exit, community face-down, community stagger, community flip, winner display) default to the standard layout’s values and each has a range from zero to twice that value; a layout declares its values in the manifest under layouts[].timing, the adapter clamps them into the ranges, and the certification run checks the declaration.
Cues and sound
useCues() returns the cues recorded on this table, oldest first, each in seat terms with the milliseconds since the hand started: deal, flip, board-reveal, chip-bet, chip-collect, chip-payout, blind-post, the six actions, win, your-turn, time-warning (five seconds left on the viewer’s clock) and chat. Chip cues come from the chip-animation store, the rest from game-state transitions; the recorder only reads.
useSound() returns a function that plays a cue id. It honours the player’s sound setting and volume, plays today’s synthesised effect for the cue, or a theme asset when one is registered for it through the sound manager’s registerCueAsset.
The DOM contract
Every contract node carries data-pe="<node>" plus data-pe-<property> attributes, for example data-pe="seat" data-pe-seat="3" or data-pe-action="raise". A layout must render every contract node, must not hide one, and must show the adapter’s value in it. The full contract is published with the contract snapshot as dom-contract.json.
The standard layout emits the attributes beside its .tbl-* class names and test ids (they carry no style, so nothing changes visually). The nodes and the properties it writes:
| Node | Properties |
|---|---|
table | seats, phase, variant |
top-bar, table-name | — |
blinds | small, big; stud tables add bring-in |
connection-status | state (shown only while disconnected) |
seat | seat, state, hero, player-id, winner; an empty seat has state="empty" and available |
seat-name | name |
seat-stack | amount |
seat-action | action (the status word), type (shown instead of the stack while a status applies) |
seat-bet | amount |
seat-cards | count, hidden; stud adds stud |
seat-card | index, card (As, Td, hidden), highlighted; stud adds visibility |
seat-timer | remaining, total (active seat only) |
seat-time-bank | seconds |
seat-role | role (small-blind, big-blind, bring-in) |
dealer-button | active |
community-cards | count, slots |
community-card | index, card (empty for an open slot), revealed, highlighted |
pot | amount, side-pots |
side-pot | index, amount |
hi-lo-split | high, low, total |
winner | amount, hand (the hand-rank banner on the winning seat) |
controls | my-turn, sitting-out |
action | action (fold, check, call, bet, raise, all-in, confirm-raise, time-bank, sit-in, post-big-blind, leave, chat-toggle, sound-toggle) plus amount, seconds, enabled, unread or open where they apply |
bet-amount, bet-slider | min, max, value |
quick-bet | preset, amount |
chat | open, enabled |
chat-messages | count |
chat-message | player-id, mine or system |
chat-input | max-length |
chat-send | — |
tournament-pause | — |
hand-for-hand | completed, tables, waiting |
mixed-rotation | next, index, count |
chip-flight | type, amount, seat |
win-odds | status, equity, opponents, street (optional; the standard layout does not show odds, see Win Odds) |
The table node also carries table (the table id), hand (the hand number) and layout (standard). Today’s layout shows neither a hand number nor a separate hand name, so hand-number (the hand number as text) and hand-rank (the winning hand’s name as text, inside the winning seat) are rendered as hidden nodes: the look does not change, and a certification can still read them. Both are optional and not visible in the contract; a layout that shows them may render them visibly.
Aria labels keep the wording certification expects, including the "Confirm raise to" label on the raise control.
A table page opened with ?peAdapterSpy=1 publishes the adapter’s current view models on window.__PE_TABLE_ADAPTER__, so a test can compare every node your layout renders against them.
Skins
A skin is a table style row: a per-table choice of layout plus token overrides. Operators manage skins under Games › Table Styles (see Tables). Precedence, later winning: layout defaults → the active theme’s --tbl-* tokens → the skin’s tokens → player preferences. The skin’s tokens are set on the table subtree (TableSkinTokens), so they win over the theme’s.
Beyond the tokens it reads (below), a theme skins the standard layout with a stylesheet scoped to the DOM contract. From sample-table (src/layouts/standard-skin/table.css):
[data-pe='table']:not([style*='--table-felt']) > * {
--table-felt: radial-gradient(circle at 50% 50%, var(--tbl-felt, #1e3a8a) 0%, var(--tbl-felt-edge, #172554) 100%);
}
The rule sets the standard layout’s own --table-felt on the table node’s children (theme CSS is layered and loses to the layout’s unlayered defaults on the node itself), gives every token a fallback, and leaves alone a table whose style sets its own felt inline. The files under src/layouts/standard-skin/ are exempt from lint-rtl, because the standard layout is locked left-to-right.
Per-table theme inheritance is not supported. A table style has a themeSlug column (migration 6), meant to resolve another theme for one table’s layout and tokens. Loading a second theme’s bundle and stylesheet for one table is outside the runtime’s single active chain, so the column is kept and returned by the API but ignored, and the admin editor no longer offers it: every table takes its layout and table tokens from the active theme.
Tokens the standard layout reads
The standard layout’s classes are .tbl-* (the files live in client/src/components/game/table/). It reads these table tokens, each with today’s value as the fallback, so a table with no tokens set looks exactly as before:
| Token | Where it shows | Fallback |
|---|---|---|
--tbl-felt | Felt centre | #047857 |
--tbl-felt-edge | Felt edge | #064e3b |
--tbl-felt-line | Betting line | rgba(255, 255, 255, 0.15) |
--tbl-rail | Light end of the rail gradient (the dark end stays #0f172a) | #1e293b |
--tbl-bar | Action bar background | rgba(15, 23, 42, 0.95) |
--tbl-card-face | Card face | #fff |
--tbl-card-ink | Black suits (and spades in the four-colour deck) | #0f172a |
--tbl-suit-red | Red suits (and hearts in the four-colour deck) | #ef4444 |
--tbl-suit-club | Clubs in the four-colour deck | #008844 |
--tbl-suit-diamond | Diamonds in the four-colour deck | #0066cc |
--tbl-pot-bg | Pot pill background | rgba(0, 0, 0, 0.5) |
--tbl-seat-bg | Seat pod background | rgba(15, 23, 42, 0.85) |
--tbl-seat-active | Active seat border | the accent (#10b981 or the skin’s accent colour) |
--tbl-seat-winner | Winner seat border | #fbbf24 |
--tbl-timer | Action timer above half time | the accent |
--tbl-timer-warning | Action timer under a quarter of the time | #ef4444 |
--tbl-chip | Chip icons and flying chips | #fbbf24 |
--tbl-dealer-button | Dealer button | #f8fafc |
--tbl-radius | Seat pod corner radius (a fixed length; the fallback scales with the table) | calc(12px * var(--t-scale)) |
--tbl-font | The table’s font family (font-family on .tbl-table-root) | the page font (inherit) |
--tbl-card-back | Card back image, drawn over the default striped back (through the layout’s own --table-card-back; cover, centred) | none (the blue stripes) |
A skin’s felt, rail and accent colour columns, when set, still win over the felt and rail tokens because the layout applies them inline. The same goes for the card back: a table style with a card-back colour or image sets the back inline and wins over --tbl-card-back; a style with only a card-back design draws the design’s pattern over the token’s image. --tbl-card-back is a path token: in tokens.json write url(assets/card-back.svg) and the server serves it with the package URL (see Tokens and Styling).
Layout source
A layout lives under src/layouts/ in the theme source: standard-skin/ for a skin stylesheet, or a folder per layout with its component and CSS. A layout is declared in the manifest under layouts and registered in defineTheme with its component and the same capabilities. From sample-table, with its timing shortened:
defineTheme({
slug: 'sample-table',
layouts: {
'sample-table': {
component: () => import('./layouts/sample-table/layout'),
capabilities: { id: 'sample-table', seatCounts: [2, 6, 9], variants: ['holdem'], modes: ['cash', 'tournament'], timing: { holeDealDelay: 450, winnerDisplay: 2500 } },
},
},
});
The component receives { table, controls, chat, tournament, timing, act }, the same view models the hooks return. It must render every DOM-contract node with the adapter’s values (certification checks them). The sample-table sample’s src/layouts/sample-table/layout.tsx is a complete example: a full-viewport grid of seats, board, pot and an action bar whose raise panel and chat send everything through act(). A layout that cannot be mirrored declares rtlLocked; otherwise lint-rtl checks its files. standard cannot be redeclared (manifest.layout-id), and a manifest with layouts but without the table surface gets a warning.