o
odinpkg.dev
packages / library / rune

rune

acecf6elibrary

A declarative UI framework for Odin with a React-like API, built on [Clay](https://github.com/nicbarker/clay) and [Raylib](https://www.raylib.com/).

No license · updated 4 months ago

Rune

A declarative UI framework for Odin with a React-like API, built on Clay and Raylib.

Prerequisites

  • Odin compiler
  • Raylib (installed via Homebrew on macOS: brew install raylib, or bundled with Odin)

Project Structure

rune/
├── cli/src/           # CLI tool
├── src/               # Rune package (vendor this folder)
│   ├── rune.odin      # Framework API
│   ├── clay/          # Clay layout engine
│   └── clay_renderer/ # Raylib renderer
├── Makefile
├── ARCHITECTURE.md
└── README.md

Building the CLI

make cli          # Debug build
make cli-release  # Release build
make clean        # Remove build artifacts
make help         # Show available targets

The CLI binary will be output to build/rune.

CLI Usage

rune <command> [options]

COMMANDS:
    new <name>    Create a new rune project
    init          Initialize rune in current directory
    run           Build and run the project
    build         Build the project
    help          Show help message
    version       Show version

OPTIONS:
    -r, --release         Build in release mode
    -t, --target <target> Cross-compile for target platform
                          (windows, linux, macos, macos-arm64, web)

EXAMPLES:
    rune new my-app                    # Create new project
    rune run                           # Build and run
    rune build --release               # Release build
    rune build -t windows --release    # Cross-compile for Windows

Creating a New Project

rune new my-app
cd my-app
rune run

This creates:

my-app/
├── src/main.odin    # Entry point
├── vendor/rune/     # Rune framework (copy from rune/src/)
├── build/           # Build output
├── assets/          # Static assets
├── rune.yml         # Project config
└── .gitignore

Example Usage

package main

import "rune"

main :: proc() {
    app := rune.create_app({
        title = "My App",
        width = 900,
        height = 700,
    })

    rune.run(app, render)
}

render :: proc(ctx: ^rune.Context) {
    using rune

    // Build your UI here
}

Architecture

Rune abstracts two layers:

  1. Clay - Layout engine (sizing, positioning, hit testing)
  2. Raylib - Rendering backend (drawing, window, input)

See ARCHITECTURE.md for detailed guidance on:

  • When to use Clay vs the Renderer
  • Data flow and lifecycle
  • Building your component API

Cross-Platform Support

The project includes pre-built Clay libraries for:

  • Windows (x64)
  • Linux (x64)
  • macOS (x64 and ARM64)
  • WebAssembly

Raylib cross-compilation is handled by Odin's vendor system.

Development

To work on the framework itself:

make cli              # Build the CLI
./build/rune --help   # Test it

# The framework code lives in src/rune.odin

License

MIT