VanGUI logo

VanGUI

Immediate-mode UI for C++ that scales up to a desktop application.

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

Tooling widgets

Where it sits

 Qt WidgetsVanGUI
ModelRetainedImmediate
SizeHundreds of MBSmall core, modules as needed
RenderingOwns the event loopYour pipeline
AnimationYesYes
StylesheetsQSS.vss
Signals and slotsYes, through mocYes, header-only
Standard dialogsYesYes
LicenceLGPL or commercialMIT

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.

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.