Parts and Part Areas

Every part area marked below as filled by default is wrapped in the product’s markup. The sample-parts sample fills site.header, site.footer and brand.logo, and the tutorial builds it.

A part is a React component that fills a host-named slot. The slot is a part area. Code, ids and these docs say "part" and "part area" and nothing else. A theme fills a part area by registering a component under the area’s id; a child theme overrides a parent’s part by registering the same id.

Part areas

Part-area ids are dotted and lowercase. The namespaces are site, brand, auth, lobby, blog, ui and table.

Part areaWhat it holdsWhere default fills it
site.header, site.nav, site.mobile-nav, site.footer, brand.logoThe page chromeMainLayout.tsx (header and logo also in AuthLayout.tsx)
site.sidebar.primary, site.sidebar.secondarySidebars, filled with section listsPageTemplates.tsx (the sidebar page templates)
lobby.tabsThe lobby tab strip (props below)LobbyPage.tsx
lobby.filtersThe filters of the active tab (tab is cash or tournaments; filters holds the values, onChange(patch) sets any of stakesFilter, gameTypeFilter, showEmpty, showFull, searchQuery, speedFilter; tabs as for lobby.tabs)LobbyPage.tsx
lobby.table-rowOne cash table; rendered twice per table, placement card (mobile) and row (desktop)TableListView.tsx
lobby.tournament-rowOne tournamentTournamentListView.tsx
lobby.private-rowOne private game: table, isRestricted, isAuthenticated, onJoin (opens the join flow); for the table’s creator (isCreator) also inviteCode, onOpen, onDelete (asks first), onCopyCode, onCopyInviteLink, onCopyDirectLink (a one-time link) and copied (code, link or direct for two seconds after a copy, else null)PrivateGamesSection.tsx
lobby.emptyThe empty state of a lobby list (tab: cash, tournaments, private)the three list files above
table.seat, table.top-bar, table.chatContract-tier parts of the standard layoutThe standard layout (client/src/components/game/table/); not fillable as parts, a theme replaces them with a table layout, which table pages cannot mount yet (not yet supported)
auth.cardThe card around each auth form (props below)client/src/pages/auth/AuthCard.tsx, used by the login, register, forgot-password, reset-password and verify-email pages in every state
blog.post-card, blog.sidebarBlog partsNot opened yet (the blog is follow-on work)
ui.avatarAn avatar drawn with the SDK Avatar (url, name, size, className)client/src/core/theme/sdk/components.tsx
ui.moneyAn amount drawn with the SDK Money (amount, currency, className, and formatted, the host’s formatted text)client/src/core/theme/sdk/components.tsx

ui.avatar and ui.money cover what themes draw through the SDK. The product’s own pages still format their amounts and draw their avatars in place, so filling these areas does not restyle those yet (not yet supported: they move to the SDK components with the member view models). Inside a part that fills ui.money, the SDK Money renders the host markup, so the part can wrap it without recursing; the same holds for Avatar.

A part registered for an area that is "not opened yet" is accepted by the validator but does not render: the host markup shows. Every area’s props are listed in PART_AREAS (src/themes/ids.ts); the lobby areas also pass the values the existing markup uses (table, tournament, isRestricted, isAuthenticated; links are built with the SDK Link from the row’s id).

Stability tiers

Every part area has a stability tier:

TierMeaning
stableThe id and its props are a semver API
experimentalMay change between minor versions
contractPart of the DOM contract that certification checks; see Testing and Certification

What the default fill is

Every part area’s default fill is the existing markup of the product, wrapped in place. When a theme does not fill an area, the player sees exactly what they see today.

client/src/themes/default/registrations.ts records where each fill lives, and tests/themes/default-contract-coverage.test.ts fails when a contract id has no fill or a wrapper disappears. providerOf('part', id) (client/src/themes/default/provider.ts) answers which theme fills an area at runtime (default when no theme in the chain registers it), so a child theme changes only what it registers.

Props a part receives

Part-area props carry what the existing markup needs, so a theme’s header can render the same links and actions the product’s header renders. The shell (client/src/layouts/MainLayout.tsx) passes the same object to site.header, site.nav, site.mobile-nav, site.footer and brand.logo:

PropValue
layoutmain
siteTitleThe site title from the SEO settings
isAuthenticated, isAdmin, isAgentThe viewer’s state
features{ cashier, agents, affiliates, tournaments, privateGames }, whether each feature is on
navItemsThe filtered navigation items the product’s header shows, then plugin pages (id plugin:<providerType>:<path>) with section: 'main' or 'account' (plugin API 1.3): put account items with the account links
menus{ header, footer, mobile, userDropdown }, the operator’s menus at those locations (empty while appearance is off)
mobileMenuOpen, openMobileMenu(), closeMobileMenu()The mobile drawer’s state
handleLogout()Signs the viewer out
loginPath/login
headerEndSlot, sidebarEndSlotThe plugin slot ids at the end of the header and the sidebar; render them with <Slot id={…} />
placementheader or mobile-nav, for brand.logo only

The auth pages (AuthLayout.tsx) fill site.header and brand.logo too, with a smaller set of props.

lobby.tabs receives:

PropValue
tabsThe tabs the feature toggles allow, in order: { id, label, path, active, count }. id is all, cash, tournament or private (Tournaments and Private Games disappear when their feature is off); label is translated; path is the tab’s URL (/lobby, /lobby/cash-games, /lobby/tournaments, /lobby/private-games); count is how many tables, tournaments or private games the tab holds before filters, or null while the tables load
activeTabThe active tab’s id
onSelect(path)Navigates to a tab’s path (a theme may also render each tab as a NavLink)

auth.card receives the form as children, heading included, and supplies the card around it:

PropValue
viewlogin, register, forgot, reset or verify
stateWhat the page shows: form on every page; 2fa, 2fa-setup and backup-codes on login; success and disabled on register; success on forgot and reset; invalid, verifying, success and error on verify
centeredWhether the default card centres its text (the result and status screens)
childrenThe form or message

Plugin slots below the form (auth.login.below-form, auth.register.below-form) render outside the card, so they keep showing whatever the part does. PART_AREAS in src/themes/ids.ts lists each area’s declared props; typed prop interfaces per area are not yet supported, so a part receives Record<string, unknown> and should check what it reads, as sample-parts does for its settings.

A part may render another part area with <Part id="…" /> from the SDK, as the sample-parts header places brand.logo. The part renders inside the theme error boundary with the default markup as its fallback: if it throws, the whole theme is deactivated for the session and the player sees default, without a reload.

Theme-owned parts

A theme may also register parts of its own under theme.<slug>.<name>, for reuse inside its templates and for child-theme overrides. Those render only where the theme’s own templates place them. Operators compose pages from sections, not from parts.

Plugin slots

Plugins add content to the product through slots (client/src/core/slot-fill/SLOTS.md). A theme part or template that replaces markup containing a slot renders it with the SDK Slot, in the same place, so plugin content survives the theme:

import { Slot } from '@pe/sdk';

<Slot id="layout.main.header.end" />
<Slot id="cashier.deposit.method-list" passProps={{ selectedMethod, amount }} />
SlotWhere the product renders itpassProps
layout.main.header.endEnd of the header (headerEndSlot). After the plugin fills the host also draws the player’s session clock (time since sign-in, data-testid="session-clock", nothing for a guest; left out below 640 px, where a phone header has no room for it and the table’s game information carries it), so place this slot in the header of every layout a signed-in player seesnone
layout.main.sidebar.endEnd of the mobile drawer (sidebarEndSlot)none
lobby.topTop of the lobbynone
auth.login.below-form, auth.register.below-formBelow the login and register formsnone
cashier.deposit.method-listDeposit method panel{ selectedMethod, amount }
cashier.withdraw.method-listWithdrawal method panel{ selectedMethod, onDestinationChange, onMetadataChange }
profile.edit.afterAfter the profile edit formnone
table.seat.badge, table.hud.panel, table.sidebar.end, table.hand-result.after (Beta)Table layouts: beside a seat’s name, a panel region, below the chat or info column, under the hand resultsee the theme contract
lobby.sidebar, home.hero.after, cashier.top, layout.main.header.start (Beta)Lobby side column, under the home hero, above the cashier tabs, header before the navigationnone
profile.header.badges, profile.stats.after (Beta)Beside the profile username, bottom of the statistics tab{ userId, isOwnProfile }
profile.actions (Beta, plugin API 1.3)Under the profile header: a row of plugin buttons{ userId, username, isOwnProfile }
profile.tabs, leaderboard.tabs (Beta, tab slots)After the profile tabs and the leaderboard; the host draws the contributed tabs (on profile.tabs, only those whose audience fits isOwnProfile, own unless it is false){ userId, isOwnProfile }, none

Contract 0.2.0: exclude names plugins whose fills the slot leaves out, for a theme that draws their feature itself from plugin data (<Slot id="lobby.top" exclude={['daily-wheel']} />); every other plugin’s fills still render.

These are THEME_SLOT_IDS (src/themes/ids.ts, typed as ThemeSlotId). Each fill renders inside the plugin’s own error boundary, as in the product. An id outside the list, the admin slots included, renders nothing (and logs a warning in development). The slots inside pages the theme does not replace keep rendering where they are.

Navigation parts read menus through the SDK’s useMenu(location), which returns the operator’s menu at that location with visibility rules already applied by the server. Each item carries its type (link, page, dropdown, divider or heading) and its target (_blank for a link that opens a new tab, which every external address does). Render a divider as a separator (role="separator"; it has no label), a heading as a label that is not a link, a dropdown as its label followed by its children, and open _blank links with target="_blank" rel="noopener". Disabled items and items the viewer may not see never arrive. Both fields are additive: on a host that does not send type, treat an item without an href as a heading. The menus prop carries the header, footer, mobile and user-dropdown menus as well (useMenu('user_dropdown') works on any page). A theme declares in its manifest which of the locations (header, footer, sidebar, mobile, user_dropdown) it renders. The host’s own navigation items and plugin fills arrive as navItems and the slot ids above; render them too, so a theme never loses a link the product or a plugin adds.

A header has what the product’s header has:

  • Active page. NavLink marks the link to the current page with aria-current="page" and activeClassName; useIsActive() returns isActive(to, { end }) for a list of items, and useLocation() the current path. By default a link is active on its path and the paths below it (/lobby on /lobby/tournaments); end makes it exact, and / is only active on the home page.
  • Language switcher. useLanguages() returns the operator’s languages, the current one, its direction, and setLanguage(code), which does what the product’s switcher does (signed-in players keep the choice in their profile). The product shows its switcher only with two or more languages; do the same.
  • Plugin slots. <Slot id="layout.main.header.end" /> in the header and <Slot id="layout.main.sidebar.end" /> at the end of the drawer.
  • Balance. useViewer() carries balance and virtualBalance; the server pushes balance changes to the page, so the header updates on its own.

A notifications bell can show the unread count from useNotificationsController({ pageSize: 1 }) (signed-in players only: render it from a child component that mounts only when useViewer().isLoggedIn, since the endpoint needs a session) and link to /notifications.

Try the live demo Pricing

Have questions about Poker Engine? We reply fast.