Operad
Operad is a renderer-neutral UI toolkit contract layer for Rust applications. It lets applications describe layout, input, widget state, actions, rendering intent, accessibility, diagnostics, resources, and host/runtime behavior without binding product code to one renderer or native window stack.
Version 5.0.0 is the v5 public API, docs, and versioning foundation. The
crate provides backend-neutral records and optional adapters; applications still
own product state, command handlers, persistence, native event loops, and final
business behavior.
What Is Included
- Retained
UiDocumenttrees with layout, hit testing, focus, scrolling, effective geometry, accessibility metadata, and renderer-neutral paint output. - Optional widget helpers behind
features = ["widgets"]for controls, menus, command palettes, text input, selection/copy policy, data widgets, pickers, surfaces, toasts, split panes, and editor-oriented primitives. - Action, command, transaction, selection, form, task, overlay, navigation, virtualization, diagnostic, theme, resource, and font lifecycle contracts.
- CPU snapshot testing helpers and optional WGPU rendering paths.
- Optional
glyphon/cosmic-textbacked text paths and an optionalaccesskit-winitbridge for native accessibility publication.
Install
[]
= "5.0.0"
Enable only the integrations you need:
= { = "5.0.0", = ["widgets", "wgpu"] }
Common feature flags:
widgets: domain-neutral widget helpers.wgpu: WGPU renderer support, including glyphon text rendering.native-window: native winit/WGPU surface smoke support.accesskit-winit: AccessKit publication bridge for winit hosts.text-cosmic: cosmic-text measurement/shaping support.egui: egui host/input compatibility.audit: audit-oriented helpers.
Examples
Render the full v5 showcase UI to a PPM snapshot:
The showcase writes target/operad_showcase.ppm by default and reports paint
and accessibility node counts. Set OPERAD_SHOWCASE_PPM=/path/to/out.ppm to
choose another output path.
Run the native WGPU host example as an offscreen smoke:
Native OS-surface execution is opt-in because it requires a display and WGPU adapter:
OPERAD_RUN_WGPU_EXAMPLE_WINDOW=1 \
OPERAD_WGPU_EXAMPLE_WINDOW_FRAMES=3 \
Documentation
Start with the v5 concept map:
docs/v5_0_core_concepts.mddocs/v5_0_migration_guide.mddocs/v5_0_theme_and_stability.mddocs/v5_0_completion_audit.mddocs/v5_0_release_checklist.md
The core rule for consumers is to keep backend-specific APIs behind local host or renderer adapters. Product-facing code should prefer Operad's stable backend-neutral records for layout, actions, transactions, accessibility, diagnostics, resources, and rendering intent.
Release Validation
The baseline v5 release gates are:
Perf and WGPU validation commands are listed in
docs/v5_0_release_checklist.md.
License
MIT. See LICENSE.