UI packages
The SDK provides two UI packages:components-ui-pixi(packages/components-ui-pixi) — PixiJS-based UI components rendered on the canvas. Handles layout, buttons, labels, and the main<UI>component.components-ui-html(packages/components-ui-html) — HTML/Svelte components for overlay UI: modals, pay table, auto-spin settings, bet menu, settings, and game rules.
The UI packages are designed to be used as a reference and starting point. For your final game, customise them to match your branding or replace them entirely. The source code is fully open.
The <UI> component
<UI> from components-ui-pixi is the main canvas UI wrapper. It accepts two Svelte 5 snippet props:
Here is the full usage example from the
lines app:
components-ui-pixi components
All components live inpackages/components-ui-pixi/src/components/:
Buttons
Labels
Layout
The
<UI> component selects a layout based on device type:
components-ui-html components
All modal and overlay components live inpackages/components-ui-html/src/components/:
Modals— container for all overlay modalsModalAutoSpin— auto-spin configuration modalModalBetMenu— bet amount selectionModalBuyBonus— bonus buy flow withModalBuyBonusConfirmModalPayTable— pay table displayModalGameRules— game rules displayModalSettings— game settings including soundModalError— error displayGameVersion— displays the game version string
Internationalisation
The SDK uses Lingui for internationalisation. Configuration lives inpackages/config-lingui.
How translations work
Thei18nDerived object in packages/components-ui-pixi/src/i18n/i18nDerived.ts provides reactive translation functions for all UI strings:
packages/components-ui-pixi/src/i18n/messagesMap/.
Social casino mode
When a game runs on a social casino platform (such as stake.us), the query string containssocial=true. The stateUrlDerived.social() function checks for this flag.
Some labels must change for social casino compliance:
This is already handled in
i18nDerived.ts as shown above — the bet and buyBonus functions branch based on stateUrlDerived.social().
Currency formatting
Use thenumberToCurrencyString function from packages/utils-shared/amount.ts to format currency values. This function delegates to Lingui’s i18n.number under the hood, so any currency supported by the Intl API is automatically handled.
The player’s currency is set from the authentication response:
NO_LOCALISATION_CURRENCY_MAP in packages/utils-shared/amount.ts, which maps those codes to custom formatting rules.