pub fn layout() -> LayoutBuilderExpand description
§layout
Emit an explicit layout node with a layout policy, draw modifier, 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
policy- the unified layout node used for measuring and placing the emitted layout node, defaulting toDefaultLayoutNodedraw- draw modifier used to record draw and compute commands for the emitted layout node, defaulting toNoopDrawModifiermodifier- 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, NoopDrawModifier, RenderSlot,
layout::{DefaultLayoutNode, layout},
};
#[tessera_ui::tessera]
fn primitive_example(modifier: Modifier, child: RenderSlot) {
layout()
.policy(DefaultLayoutNode)
.draw(NoopDrawModifier)
.modifier(modifier)
.child(move || child.render());
}