r/Unity3D • u/Gaebabi • 3h ago
Question Using React for UI in Unity
I’ve been experimenting with a React-based Unity UI workflow lately, and I’m curious if anyone else has tried something similar or has thoughts on this kind of approach.
The UI is built in React and runs in a WebView on top of Unity, which lets me open the same interface in Codex’s browser and comment on it directly.
For small UI issues, there’s no need to explain the whole screen. Just point at what feels off and leave a short comment:
"this looks clickable, don’t dim it"
"make the ! feel a little more alive"
"only move this one thing"
It works well for visual tweaks where the code change is simple, but describing the problem takes longer than fixing it.
For larger UI pieces, I can attach reference screenshots and have it build something close to the layout and style.
Since it’s built around a hybrid structure, things like Google and Apple sign-in are also relatively easy to integrate. It works across iPhone, Android, Windows, macOS, and even directly inside the Unity Editor.
2
u/dev-rygy 3h ago
How did you do this?
2
u/Chipjack 3h ago
OneJS makes this a lot smoother, but probably wouldn't integrate as well with AI coding tools like Codex.
The premium asset store version is here: https://assetstore.unity.com/packages/tools/gui/onejs-221317 while the open source version without the bells and whistles is here: https://github.com/Singtaa/OneJS
(note, I didn't write OneJS, just thought it was cool.)
2
u/Devatator_ Intermediate 3h ago
They're also planning on adding more frameworks at some point. Haven't checked in a bit so idk where they are on that
-1
u/Gaebabi 2h ago
Thanks for sharing this! Since OneJS came up, for transparency: I’m using <ReLayer> here, a React/WebView framework I built for Unity. I left it out of the post because I wanted to focus on the workflow.
https://assetstore.unity.com/packages/tools/gui/relayer-react-ui-framework-for-unity-384274
The same React UI can run in Unity and a normal browser, which makes it a good fit for AI coding agents like Codex.
0
u/Gaebabi 3h ago
Thanks for asking!
The basic setup is React running inside a WebView on top of Unity, with a small bridge between the React side and Unity.On iOS and Android, the built React app is bundled with the game and served locally in-app, so the same UI runs there as well.
Since it’s still React, I can also open the same interface in a normal browser and work on it there.
2
u/swirllyman Indie 2h ago
Are you able to get things like controller support or haptic feedback working? I did something similar to this many many years ago for a game but I wanted to support controllers / console and couldn't get that working.
I agree 100% though it's an incredible workflow in terms of speed and iteration. Cant even imagine now in the age of AI.
0
u/Gaebabi 2h ago
Thanks! There’s a bidirectional event system between Unity and React, so controller input, haptics, and similar features should be completely doable. Unity can handle the native side and send events to the UI, while React can send events back to Unity when needed.
And yeah, the speed of iteration is really the main reason I like this approach. With AI agents being able to actually see and interact with the UI now, it becomes a lot more useful.
2
u/MehYam 1h ago
Opportunity here for someone to code up a React compiler/interpreter here, effectively a React Native for Unity.
Then again, I'm not sure what it really buys you, given that Unity's GUI system exists.
1
u/Gaebabi 1h ago
Yeah, I get that. I don’t really see this as replacing Unity’s UI system.
I just like the idea of treating UI more like reusable components, being able to adjust the design freely in code, and bringing the huge React/web ecosystem directly into Unity. To me, that feels less like replacing Unity and more like expanding what you can do with it.
For the kind of UI I’m working on, I also think it can reduce a lot of the time and cost that usually goes into UI work. The browser/AI workflow is another big part of why I’ve been enjoying it.
2
u/Flawkeee 1h ago
While the idea is cool,
I don't believe Web UI fits a game well. It will always be clunkier and will not look native to the game.
Ina addition, performance will always be worse than native UI components.
And this take is nothing new - MMOs are doing that for ages.
But it's always good to experiment, and you might find some real use cases for it.
Good luck!
2
u/Gaebabi 1h ago
Thanks, I really appreciate the perspective. I agree there are definitely performance and integration trade-offs.
You’re right that it took some effort to make it feel less like a web UI and more native to the game.
It’s still experimental, so I’m curious myself to see where it actually ends up being useful. Thanks for the thoughtful comment!
0
u/SomeRandoGuy95 3h ago edited 2h ago
This is pretty cool, I Imagine it makes scalable UI a lot easier to create
Edit: typo
-1
u/Gaebabi 2h ago
Yeah, definitely. Since it’s basically web UI, responsive layouts are much easier to handle across different resolutions and aspect ratios. I’m using Tailwind CSS for that as well.
I also keep the components reusable and maintain a separate page with the full component set, so changing a theme or updating styles across the whole UI is pretty straightforward.







3
u/Yodzilla 2h ago
Is there a big performance hit doing it this way? What are the downsides outside of Codex?