Quickstart

Install Vel, write your first .vel file, and run the showcase.

Requirements

  • C++20 compiler — Clang 15+, GCC 12+, or MSVC 19.36+
  • CMake 3.24+
  • Ninja
  • macOS 13+ for full support. Linux and Windows builds compile, but the platform surface layer is in progress.

Install

git clone https://github.com/chan27-2/Vel.git
cd Vel
./scripts/install-vel.sh       # bootstraps vcpkg + deps under ~/.vel/
cmake --preset default          # downloads Dawn, FreeType, HarfBuzz
cmake --build build             # builds libvel + velc + showcase
./build/showcase                # run the demo

Hello, Vel

Create a file called hello.vel:

#Hello
  @name = "world"
  V p=lg g=md
    T "Hello, {$name}" font=bold/title
    In placeholder="Name" value=$name

A thin main.cpp boots the app and mounts the component:

#include "vel/App.h"
#include "hello.vel.h"

int main() {
    vel::App app(480, 240, "Hello");
    app.setRoot(std::make_unique<Hello>());
    return app.run();
}

And a tiny CMakeLists.txt wires the compiler in:

find_package(vel CONFIG REQUIRED)
add_executable(hello main.cpp)
target_link_libraries(hello PRIVATE vel)
add_vel_sources(hello hello.vel)

Build and run:

cmake --preset default
cmake --build build
./build/hello

Type in the field. The signal updates. The label re-renders. ~0 CPU when nothing changes.

Hot reload

Once the showcase is building, the hot-reload loop is one command:

./scripts/dev-hot.sh examples/showcase.vel

Save any .vel file. In under a second the plugin recompiles and the widget tree swaps. Scroll position, focus, drag state, signal values — all preserved.

See Recipes › Hot reload for how the plugin model works under the hood.

Where next