Operad
A cross-platform GUI library for Rust.
Features
- Simple, renderer-neutral API.
- Retained UI tree with flexible layout.
- Built-in widgets and editor controls.
- Type-safe actions and commands.
- Accessibility and input handling.
- WGPU renderer support.
- Custom drawing surfaces.
- Headless testing utilities.
Overview
The shortest path to a native window is run_ui_document:
use ;
The runner opens the window, creates the renderer, lays out the document, and
routes input. Use run_app when widget actions should update application state;
the showcase example is a compact app built that way.
For custom WGPU drawing, add a GPU canvas to the document and register a canvas renderer:
let mut canvases = new;
canvases.register;
run_app_with_canvas_renderers?;
The renderer callback gets the canvas texture context, so it can record normal WGPU command buffers and render passes before Operad composites the UI.
Install
Feature Flags
widgets: widget helpers.native-window: native winit/WGPU windows.wgpu: WGPU rendering.accesskit-winit: AccessKit support for winit hosts.text-cosmic: cosmic-text measurement and shaping.egui: egui host/input compatibility.egui-renderer-compat: egui renderer compatibility.audit: audit helpers.
Examples
Open a native window: