@open-slot-ui/core
v0.8.3
Published
Headless, zero-dependency core for open-ui — signals, control state-machines, theme tokens, layout, façade, event bus and introspection for slot-game UIs.
Downloads
4,362
Maintainers
Readme
@open-slot-ui/core
The headless core of open-ui — a biased,
themeable UI library for slot games. This package is the M + C: all state, logic,
layout and theming, with zero runtime dependencies. It renders nothing on its own;
pair it with a view binding such as @open-slot-ui/pixi.
pnpm add @open-slot-ui/coreWhat's inside
Signal— a tiny observable value (the reactive primitive everything is built on).Controlstate-machines — every button/toggle/value is an FSM; interactability is derived from state, never a stored boolean.OpenUIfaçade — the narrow, typed surface a host talks to (ui.spin.busy(),ui.balance.set(…),ui.bus.on(…),ui.setLocale(…)).- Theme tokens — semantic design tokens with safe fallbacks (
default,midnight,neon,light). A bad token degrades, never throws. - Layout — anchor + offset + scale (+ rotation) resolved against a reference resolution, with per-device responsive overrides.
UISpec— one typed, string-literal config object validated without ever throwing (a bad value is reported and ignored — see the never-reject boundary in the Charter).- Introspection —
window.__OPENUI__reports every control's state, interactability and bounds, so end-to-end tests never read a pixel.
Usage
You normally don't construct core directly — a renderer like @open-slot-ui/pixi builds it
from your UISpec via mountHud. Reach for @open-slot-ui/core directly when you're writing
your own renderer (DOM, Canvas, another engine) against the same headless model.
import { OpenUI, defaultTheme } from '@open-slot-ui/core';See the main README and the Charter for the full doctrine.
License
MIT © schmooky and the open-ui contributors.
