Skip to main content

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.
Both packages are functional and include features like auto-gaming, turbo mode, bonus buy, and responsive layout. They are a starting point, not a final product.
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 in packages/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 in packages/components-ui-html/src/components/:
  • Modals — container for all overlay modals
  • ModalAutoSpin — auto-spin configuration modal
  • ModalBetMenu — bet amount selection
  • ModalBuyBonus — bonus buy flow with ModalBuyBonusConfirm
  • ModalPayTable — pay table display
  • ModalGameRules — game rules display
  • ModalSettings — game settings including sound
  • ModalError — error display
  • GameVersion — displays the game version string

Internationalisation

The SDK uses Lingui for internationalisation. Configuration lives in packages/config-lingui.

How translations work

The i18nDerived object in packages/components-ui-pixi/src/i18n/i18nDerived.ts provides reactive translation functions for all UI strings:
Message catalogues for each locale live in 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 contains social=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().
If you add custom UI text that needs a social casino variant, follow the same pattern: check stateUrlDerived.social() and return the alternative string.

Currency formatting

Use the numberToCurrencyString 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:
Special currencies: Some social casino platforms (such as stake.us) use non-standard currency codes that the Intl API does not recognise. These are handled by NO_LOCALISATION_CURRENCY_MAP in packages/utils-shared/amount.ts, which maps those codes to custom formatting rules.