psychic-ui 0.0.0
Loading...
Searching...
No Matches
Psychic UI

CI

A retained-mode C++23 UI library: Skia draws, Yoga lays out with flexbox, and a CSS-like style system drives both. Components get their looks from skin sets and themes, with light and dark, pointer and touch densities, motion, popups, lists and text editing built in. It runs on its own with SDL3, or inside an existing SDL3 or GLFW application, on Linux, macOS and Windows.

See it, with screenshots of every component under each skin set: https://ubald.github.io/psychic-ui/

Psychic UI's demo app

Building

CMake 3.24 or newer and a C++23 compiler (GCC 14+, Clang 18+, Apple Clang 16+, or clang-cl on Windows). Skia, Yoga and psychic-color are submodules; Skia is built by CMake on the first build, which takes a while.

git submodule update --init --recursive
cmake --preset debug
cmake --build --preset debug -j"$(nproc)"
./build/debug/example/psychic-ui-demo # the demo app
ctest --preset debug # the tests

On Linux, Skia uses the system's ICU, HarfBuzz, FreeType and Fontconfig, and SDL3 and GLFW are downloaded when they aren't installed; CLAUDE.md has the details for every platform, the CMake options and the architecture.

Using it in your project

Inside your own CMake project it builds as a static library, without its tests and examples:

add_subdirectory(psychic-ui)
target_link_libraries(my-app PRIVATE psychic-ui::psychic-ui)
psychic_ui_copy_resources(my-app) # the bundled fonts, next to the executable
app.open(std::make_shared<MyWindow>());
app.run();
Definition SDL3Application.hpp:21
SDL3SystemWindow & open(std::shared_ptr< Window > window)
Definition SDL3Application.cpp:52
void run()
Definition SDL3Application.cpp:211

-DPSYCHIC_UI_SKIA_DIR=<dir> links an already built Skia instead of building one. To embed it in an application that already has a window and a loop, see the adapters in psychic-ui/applications/ and example/glfw-host.

License

MIT, see [LICENSE](LICENSE). The bundled fonts keep their own licenses (Inter: SIL OFL 1.1, Ubuntu: the Ubuntu Font Licence, in res/fonts/), as do the Lucide icons (ISC, psychic-ui/icons/LICENSE-Lucide.txt).

Thanks to everyone who has starred, used or contributed to it.