Component Reference
Choose a layout container, content primitive, or control, then refine it with common view modifiers.
The public components all implement View, so you can combine containers, content, and controls within the same hierarchy. Start with the component that expresses the role you need, then import ViewExt to refine its layout and appearance through common modifiers.
Each component page includes a reference section for its own configuration methods, with signatures, behavior, and examples. Components without additional builder methods identify their constructor inputs and the shared modifiers that apply to them. The View Modifiers reference covers the common API available across components.
Layout Containers
- v_stack arranges children vertically.
- h_stack arranges children horizontally.
- z_stack overlays children with alignment.
- grid arranges row-major tracks.
- spacer distributes unused stack space.
- scrollable creates a clipped viewport with wheel scrolling and draggable indicators.
Content Primitives
- rectangle paints a rectangular shape with optional radius and border.
- text shapes and measures styled text.
- image_buffer displays an imported image buffer.
- vector_path describes retained vector fill and stroke geometry.
- surface_view embeds another Hera surface.
Controls
- button provides activation and retained interaction state.
- toggle edits a boolean binding.
- text_field edits Unicode text, selection, and optional formatting.
Shared View Behavior
If you are deciding how components should fit together, layout fundamentals explains how proposals and intrinsic sizes determine their bounds. The view modifiers guide builds on those rules to cover padding, frames, backgrounds, clipping, environment, identity, and memoization.
Some configuration belongs to a concrete primitive, such as a rectangle's radius or a text view's font. Its reference page describes those methods. Apply them before common modifiers that return a wrapper type, since the wrapper may no longer expose the primitive-specific methods.
Source Reference
The following files in the Hera checkout define the behavior described on this page.
crates/kit/src/lib.rscrates/kit/src/view/primitives.rscrates/kit/src/view/controls.rs