Hera Kit
Compose native Rust interfaces from views, observable state, and typed environment values.
Hera Kit provides a declarative Rust API for building applications on Hera. You compose an interface from functions, reusable view types, containers, and controls, then let the toolkit evaluate that description and resolve its layout. Kit reconciles the result into protocol diffs for the server to render and present.
Declarative View Descriptions
A view is a description that the toolkit evaluates when it needs an updated interface. Constructing text("Ready") or v_stack() creates that description without drawing immediately. During evaluation, Kit builds a candidate client tree that brings geometry, callbacks, environment scopes, and mounted state ownership together for the proposed update.
Author a view through View::body, view_fn, or the optional #[view] macro, leaving node IDs and UiNode construction to the toolkit. Specialized integrations can opt into those lower-level responsibilities through hera_kit::backend when they need direct access to the evaluated client tree.
Data and Interaction
A view receives ordinary inputs as owned props and keeps local, persistent data in mounted state. A Binding<T> provides access to that state, allowing a parent to pass editing access to a child without creating a second copy of the value. This makes ownership explicit even when several controls work with the same model.
When many descendants need the same configuration or model, the environment can supply it through the hierarchy. Typed keys carry configuration, while environment objects share a model through Rc. Observable fields still need state or bindings so that model changes participate in the runtime's update mechanisms.
Toolkit Guides
Begin with getting started to build a complete application and see how an action becomes a scene update. The following guides develop that example's ideas through views and composition, state and bindings, environment, and layout.
The component reference has individual guides for stacks, grids, content primitives, scroll containers, and controls. Internals explains attribute propagation, mounted identity, layout attributes, and accepted-tree reconciliation.
Current Scope
Kit provides physical cross-axis stack alignment and intrinsic-size layout with spacers. Baseline alignment, layout priorities, custom layout protocols, virtualized lists, semantic accessibility, and view-owned cancellable async effects remain separate platform work.
Use these capabilities as they exist today rather than assuming that similarly named APIs from another framework have identical semantics.
Source Reference
The following files in the Hera checkout define the behavior described on this page.
crates/kit/README.mdcrates/kit/src/lib.rscrates/kit/src/view/mod.rs