beuvy
beuvy is a Vue-flavored declarative UI layer for Bevy. It lets you describe
UI with a compact SFC-like template format, parse it into typed assets, and
materialize it with the reusable controls from beuvy-runtime.
Use beuvy when you want:
<template>-driven UI authoring- Vue-style directives like
v-if,v-show,v-for,v-model, and@click - runtime bindings, refs, localized text, and style patches on top of Bevy UI
Crates
beuvy: the high-level declarative authoring crate.beuvy-runtime: reusable Bevy UI controls, utility-class styling, and state-driven visual styles used underneathbeuvy.
Version Compatibility
| beuvy | bevy | MSRV |
|---|---|---|
| 0.1 | 0.18 | 1.85 |
Install
[]
= { = "0.1.0", = false, = ["vue"] }
If you want the current default bundle:
[]
= "0.1.0"
Low-level runtime usage lives in
beuvy-runtime/README.md.
Quick try:
Example
Run the Vue-style page example with:
It shows:
- Rust props via
DeclarativeUiBuildContext::with_root - Rust runtime values via
DeclarativeUiRuntimeValues - Rust actions via
set_action_resolverandDeclarativeActionMessage
The example also inserts FontResource explicitly. Published crates no longer
bundle a default font asset, so real apps should either set --font-ui in
their stylesheet or insert a font resource in Rust the same way.
Vue-Style Authoring
beuvy accepts a compact SFC-like format with top-level <template>, optional
<script>, and optional <style> blocks. The current surface focuses on
pragmatic UI authoring rather than full Vue compatibility.
Supported patterns include:
v-if,v-else-if,v-else,v-showv-forv-model:class,:style,:value,:disabled,:ref@click,@input,@change,@scroll,@wheel{{ mustache }}text interpolation and$t(...)localized text
Current Authoring Focus
beuvy currently targets practical Vue-style UI authoring for Bevy, with a
usable "form + content basics" surface instead of full browser / DOM parity.
That includes:
- common structural tags and text tags
- core form controls with
v-model - basic content tags such as images, links, separators, and lists
- Vue-style bindings, refs, conditional rendering, and repeated rendering
Current notable limits:
- no
tablefamily yet - no
video,audio, orcanvas brand full inline-flow layout are intentionally deferred
Example:
{{ title }}
Inventory
Hello {{ draft.name }}
{{ entry.text }}
Bevy Integration
Register the declarative runtime plugin:
use *;
use DeclarativeUiPlugin;
Programmatic parsing is also available:
use parse_declarative_ui_asset;
let asset = parse_declarative_ui_asset?;
Feature Layout
runtime: re-exportsbeuvy-runtimefor direct low-level use.declarative: parser, asset loader, shell materialization, bindings.vue: preferred high-level feature alias for declarative authoring.
License
Licensed under the Apache License, Version 2.0.