Every part area marked below as filled by
defaultis wrapped in the product’s markup. Thesample-partssample fillssite.header,site.footerandbrand.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 area | What it holds | Where default fills it |
|---|---|---|
site.header, site.nav, site.mobile-nav, site.footer, brand.logo | The page chrome | MainLayout.tsx (header and logo also in AuthLayout.tsx) |
site.sidebar.primary, site.sidebar.secondary | Sidebars, filled with section lists | PageTemplates.tsx (the sidebar page templates) |
lobby.tabs | The lobby tab strip (props below) | LobbyPage.tsx |
lobby.filters | The 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-row | One cash table; rendered twice per table, placement card (mobile) and row (desktop) | TableListView.tsx |
lobby.tournament-row | One tournament | TournamentListView.tsx |
lobby.private-row | One 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.empty | The empty state of a lobby list (tab: cash, tournaments, private) | the three list files above |
table.seat, table.top-bar, table.chat | Contract-tier parts of the standard layout | The 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.card | The 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.sidebar | Blog parts | Not opened yet (the blog is follow-on work) |
ui.avatar | An avatar drawn with the SDK Avatar (url, name, size, className) | client/src/core/theme/sdk/components.tsx |
ui.money | An 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:
| Tier | Meaning |
|---|---|
stable | The id and its props are a semver API |
experimental | May change between minor versions |
contract | Part 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:
| Prop | Value |
|---|---|
layout | main |
siteTitle | The site title from the SEO settings |
isAuthenticated, isAdmin, isAgent | The viewer’s state |
features | { cashier, agents, affiliates, tournaments, privateGames }, whether each feature is on |
navItems | The 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, sidebarEndSlot | The plugin slot ids at the end of the header and the sidebar; render them with <Slot id={…} /> |
placement | header 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:
| Prop | Value |
|---|---|
tabs | The 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 |
activeTab | The 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:
| Prop | Value |
|---|---|
view | login, register, forgot, reset or verify |
state | What 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 |
centered | Whether the default card centres its text (the result and status screens) |
children | The 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 }} />
| Slot | Where the product renders it | passProps |
|---|---|---|
layout.main.header.end | End 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 sees | none |
layout.main.sidebar.end | End of the mobile drawer (sidebarEndSlot) | none |
lobby.top | Top of the lobby | none |
auth.login.below-form, auth.register.below-form | Below the login and register forms | none |
cashier.deposit.method-list | Deposit method panel | { selectedMethod, amount } |
cashier.withdraw.method-list | Withdrawal method panel | { selectedMethod, onDestinationChange, onMetadataChange } |
profile.edit.after | After the profile edit form | none |
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 result | see 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 navigation | none |
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.
Menus and the navigation part
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.
NavLinkmarks the link to the current page witharia-current="page"andactiveClassName;useIsActive()returnsisActive(to, { end })for a list of items, anduseLocation()the current path. By default a link is active on its path and the paths below it (/lobbyon/lobby/tournaments);endmakes it exact, and/is only active on the home page. - Language switcher.
useLanguages()returns the operator’s languages, the current one, its direction, andsetLanguage(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()carriesbalanceandvirtualBalance; 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.