π¦ KAPLAY-UI π§©
A lightweight and flexible UI plugin for KAPLAY, built to feel like a natural extension of the engine.
Create UI elements quickly using familiar KAPLAY primitives β buttons, labels, HUD elements, menus, and more.
π Why KAPLAY-UI?
- π§© Works exactly like native KAPLAY
- ποΈ Easy, declarative API
- β¨ Sensible styling defaults
- π¨ Fully customizable
π¦ Installation (v1.0.0-alpha*)
npm install kaplay-ui@next
π§° Getting Started
Add the plugin when creating your KAPLAY instance:
import kaplay from "kaplay";
import kaplayUI from "kaplay-ui";
const k = kaplay({
plugins: [kaplayUI],
});
Now create a UI element:
const tb = k.addTextButton("Play");
const sl = k.addLabel("Score: 0");
Thatβs it β youβre ready to build UI!
π§± Core Components
π€ Text Button
Create an interactive button with centered text and builtβin outline & area detection.
const tb = k.addTextButton("Play");
tb.onClick(() => k.go("game"));
π·οΈ Label
A small, flexible text element β perfect for HUDs.
const lbl = k.addLabel("Score: 0");
lbl.setLabelText("Score: 1");
More components are being added soon as the plugin grows. π
π Documentation
You can find more details here:
-
π plugin API
β How the plugin integrates into KAPLAY -
π§± Components API
β All UI components and their options -
π faq.md
β Questions and answers
And soon also:
-
π§ͺ Examples
β Learn by doing! -
πͺ§ Demos
β See it in action .. -
π§ design-decisions
β The Whys?
πΊοΈ Roadmap (WIP)
-
β³ More component types
(sliders, toggles, panels) -
π¨ Theme presets
(built-in light/dark UI packs) -
ποΈ Complex layout helpers
(stacks, grids) -
π Full documentation site
(getting started, faq and .. more)
π€ Contributing
Contributions and feature ideas are warmly welcome!
Feel free to submit issues or PRs on GitHub β or share ideas in the discussions tab.
π License
MIT Β© 2026 Jonas Bak Phillipson
Made with π + π¦ by:
The KAPLAY Community