VanGUI is an immediate-mode UI library for C++23. The interface is rebuilt every frame, so there's no widget tree to keep in sync, and it renders inside whatever pipeline you already have.
On top of that core we wrote 40 optional modules for the parts a finished tool needs: animation, themes and stylesheets, standard dialogs, signals and slots, model/view adapters, a command palette, and tooling widgets like a hex editor and a data grid. Each module is its own build switch. Leave one off and its source compiles to nothing; leave them all off and what's left is the bare immediate-mode core.
A first window
#include <vangui/van.h>
using namespace van;
// between VanGui::NewFrame() and VanGui::Render():
if (auto w = window("Settings", { .size = {420, 300}, .p_open = &open })) {
heading("Display");
row([&]{
button("Save", { .primary = true }).on_click(save).tooltip("write to disk");
button("Cancel").on_click([&]{ open = false; });
});
checkbox("V-Sync", cfg.vsync);
slider("Volume", cfg.volume, 0.f, 100.f, "%.0f%%");
toast_success("Saved");
}
Two calls per frame drive the modules that need a tick, such as theme transitions, toasts and the command palette:
#include <vangui/misc/vangui_enhance.h>
VanGui::NewFrame();
VanGui::NewFrameExtras(); // transitions, stylesheet reload, thread results
// ... your UI ...
VanGui::RenderExtras(); // toasts and the command palette
VanGui::Render();
The modules
Application building blocks
- Animation: tweens, springs and easing, advanced once per frame without extra calls
- Loading spinners, progress rings and skeleton placeholders
- Toast notifications, feedback prompts, banners and snackbars
- A theme engine, named themes,
.vssstylesheets and a theme editor - Standard dialogs that return
std::expected - Layout helpers, forms, panels and application chrome, a toolbar builder
- Signals and slots with RAII connections and no code generator
- Model/view adapters with virtualized lists
- An actions registry, keyboard shortcuts and a command palette
- A node graph, charts, a drop zone, a wizard, and a
.vuilayout loader - A thread pool whose results come back on the UI thread
Tooling widgets
- A log console, and a command console with history and tab completion
- A property grid
- A curve and gradient editor
- A date and time picker
- A hex editor
- A real-time plot and a performance HUD
- A timeline for sequencing
- A data grid with filtering and sorting
- Markdown and rich text
- Drag-to-reorder lists and a small string catalogue for translations
Where it sits
| Qt Widgets | VanGUI | |
|---|---|---|
| Model | Retained | Immediate |
| Size | Hundreds of MB | Small core, modules as needed |
| Rendering | Owns the event loop | Your pipeline |
| Animation | Yes | Yes |
| Stylesheets | QSS | .vss |
| Signals and slots | Yes, through moc | Yes, header-only |
| Standard dialogs | Yes | Yes |
| Licence | LGPL or commercial | MIT |
Adding it to a project
list(APPEND CMAKE_PREFIX_PATH "path/to/VanGUISDK/cmake")
find_package(VanGUISDK REQUIRED)
target_link_libraries(my_app PRIVATE VanGUI::suite) # brings in VanGUI::core
Then compile one platform backend and one renderer backend from backends/, for example vangui_impl_win32.cpp with vangui_impl_dx11.cpp. They build against your own copy of the graphics SDK.
The prebuilt libraries are compiled with every module on and against the vanconfig.h that ships with them. Some settings in that file change the layout of structs in the public headers, so if you edit them while linking the prebuilt libraries you get memory corruption rather than a link error. For a different configuration, other architectures, or a smaller module set, build from source, where each module is its own CMake option.
- A C++23 compiler: MSVC 19.38 or later (Visual Studio 2022 17.8).
- Windows 10 1903 or later.
- CMake 3.28 if you use CMake.
Licence
VanGUI is MIT licensed. The bundled stb libraries are by Sean Barrett. The modules and the van:: facade are TeamVanilla's own work. Third-party notices for the bundled components ship in the NOTICE file with the SDK.
