This page covers the general overview of OneJS. If you’re eager to dive right in, head over to the Getting Started page!
Documentation for our Game UIs is here: UI Docs.
Overview
OneJS lets you use JavaScript in Unity, for both runtime and editor. It focuses on UI scripting but works for anything you’d usually handle with JS.
It integrates directly with Unity’s UI Toolkit , a shader-based, retained-mode UI system inspired by web tech. UI Toolkit already offers web concepts like DOM and CSS, and OneJS complements it by having a JavaScript backend (QuickJS, V8, or NodeJS via Puerts ) and turbo-charges your UI workflow using familiar toolings like TypeScript, Preact, Tailwind, and ESBuild.
Why use OneJS
- Lightning-fast iteration: Change your UI code and see results instantly. No more domain reloads.
- Familiar tooling: Use TypeScript, (P)React, Tailwind and other web techs you already know and love.
- Broaden the talent pool: Studios can tap into web devs for UI work.
- Unity-native: Works directly with UI Toolkit - no browser, no overhead.
- Desktop and Mobile: Tested on Windows, Mac, iOS, and Android.
- Powerful scripting: Give your players the ability to mod your game with TypeScript and JSX.
JavaScript pretty much runs the show when it comes to modern UI, thanks to all the frameworks and tools that make dev work smoother across the board. It’s constantly evolving, super flexible, and backed by a huge community. What we’re aiming for is to bring as much of that web tech into Unity as we can, so we get the best of both worlds.
Limitations
OneJS uses Unity’s UI Toolkit as its DOM layer, so keep in mind that UI Toolkit only supports a limited set of DOM and CSS features. Here’s what’s not supported (yet):
- Canvas (but there’s a Vector API workaround)
- SVG (partially supported now, but still room to grow)
- Complex CSS selectors (i.e. Tailwind’s
space-
classes won’t work since> * + *
isn’t supported) - CSS animations and keyframes (on UI Toolkit’s roadmap)
WebGL support isn’t in yet, but it’s coming in V2. It’ll follow Puerts’ WebGL workflow and run on the browser’s JS engine. Stay tuned.
The Game Dev DNA
Unity’s UI Toolkit isn’t as flexible as web tools, but that’s by design. It’s built for performance and fits right into the game dev DNA, where constraints aren’t a drawback, they’re a creative push. Everyone’s working with the same limitations, which keeps things fair and often leads to smarter, more original solutions.
That said, UI Toolkit is already a big step up compared to most native UI renderers out there. It actually supports things like a real DOM and stylesheets, which is more than you can say for Flutter or React Native. Since it’s based on familiar web standards, you’re building your game UIs on a solid and future-proof foundation. And of course, if you’re using OneJS, it takes everything up a notch.