pub fn layout() -> LayoutBuilderExpand description
§layout
Emit an explicit layout node with a layout policy, render policy, modifier chain, and optional child slot.
§Usage
Build framework or internal components that need to define explicit layout and rendering behavior inside a tessera composition boundary.
§Parameters
layout_policy- pure layout policy used for measuring and placing the emitted layout node, defaulting toDefaultLayoutPolicyrender_policy- render policy used to record draw and compute commands for the emitted layout node, defaulting toNoopRenderPolicymodifier- node-local modifier chain attached before child content is emitted, defaulting to an emptyModifierchild- optional child slot rendered as the emitted node’s content subtree
§Examples
use tessera_ui::{
Modifier, NoopRenderPolicy, RenderSlot,
layout::{DefaultLayoutPolicy, layout},
};
#[tessera_ui::tessera]
fn primitive_example(modifier: Modifier, child: RenderSlot) {
layout()
.layout_policy(DefaultLayoutPolicy)
.render_policy(NoopRenderPolicy)
.modifier(modifier)
.child(move || child.render());
}