Analysis updated 2026-05-18
Build a component-based UI for a game or game engine using React-style hooks and state management.
Add a diff-based virtual DOM UI layer to a CAD or desktop tool written in C++.
Plug c++react into a custom renderer such as RmlUi to display the interface it manages.
| geforcefan/cppreact | ashishps1/tetris-game | bodmer/esp8266-weather-station-color | |
|---|---|---|---|
| Stars | 10 | 10 | 10 |
| Language | C++ | C++ | C++ |
| Last pushed | — | 2017-01-11 | 2018-10-15 |
| Maintenance | — | Dormant | Dormant |
| Setup difficulty | moderate | moderate | moderate |
| Complexity | 4/5 | 2/5 | 3/5 |
| Audience | developer | developer | general |
Figures from each repo's GitHub metadata at analysis time.
The library itself does nothing without a separate renderer wired in, such as RmlUi with GLFW and OpenGL as shown in the demo.
c++react brings the React programming model, the one popular in web development, into C++. It gives you function components, hooks like the ones React developers already know, and a virtual DOM that only updates the parts of the interface that actually changed. The author built it for building user interfaces inside things like games, CAD editors, or a graphical tool embedded in a game engine such as Unreal Engine 5, which is one of the places they have used it themselves. Importantly, c++react does not draw anything to the screen on its own. It only manages components, state, and the virtual DOM diffing, and you point it at a separate renderer that actually draws pixels. The included demo uses a library called RmlUi, which renders HTML and CSS style interfaces through OpenGL, to show a small desktop todo application built with c++react's components. The library supports the hooks a React developer would expect, such as ones for managing state, running side effects, and memoizing values, along with keyed lists, context for sharing values down a component tree, portals, and synthetic events. State updates are batched, meaning changes queue up and get applied together once per frame rather than immediately. It has no external dependencies, targets the C++20 standard, and can build without exceptions or runtime type information enabled. Because it is header only, using it just means fetching the repository, for example through CMake's FetchContent, and linking against it, or copying the include directory directly into your own project, there is nothing to separately compile. On its own the library does nothing useful, since it needs a renderer wired in to actually display anything, as the bundled demo shows by combining it with a windowing library, OpenGL, and RmlUi. The project is explicitly labeled alpha and experimental, not yet recommended for production use, and the author welcomes bug reports and pull requests. It is released under the MIT license. The full README is longer than what was shown.
c++react brings React's component, hooks, and virtual DOM model to C++, for building UIs in games or tools like CAD editors, with rendering left to a renderer you plug in yourself.
Mainly C++. The stack also includes C++, CMake, RmlUi.
MIT license: use freely for any purpose, including commercial use, as long as you keep the copyright notice.
Setup difficulty is rated moderate, with roughly 1h+ to a first successful run.
Mainly developer.
This repo across BitVibe Labs
Verify against the repo before relying on details.