absolute_fill

absolute_fill(...) is a small helper that wraps one child in an AbsoluteFill layout node.
In plain language, it tells the runtime, "give this child the same width and height as the parent bounds." That makes it useful for scrims, loading overlays, full-surface backgrounds, and any layered content that should cover the whole stack.
Use it when the child should fill an existing layered area. Do not reach for it when you only need ordinary full-width layout in a Row, Column, or Container; those cases are better handled with normal box constraints, flex, or padding.

Example

A common pattern is a dimming scrim behind a modal or popover.
use fission::prelude::*;

let widget: Widget = ZStack {
    children: vec![
        Text::new("Main content").into(),
        absolute_fill(
            Container::new(Text::new("").into())
                .bg(fission::core::op::Color {
                    r: 0,
                    g: 0,
                    b: 0,
                    a: 140,
                })
                .into(),
        ),
    ],
    ..Default::default()
}
.into();
The helper does not add styling or input behavior by itself. It only changes sizing. In this example, the Container provides the background color while absolute_fill(...) makes that container cover the whole stacked area.

Field table

Field
Type
Meaning
Notes / default behavior
child
Widget
The node that should fill the parent's bounds.
Required. The helper returns a Widget rather than a widget struct with public fields.

Behavior and advice

absolute_fill(...) is most useful inside layered layouts such as ZStack or widgets that already build a stack internally, such as Overlay. The layout engine treats AbsoluteFill specially and gives the child tight constraints equal to the available parent size.
If you need an anchored overlay such as "top-right badge" or "bottom sheet handle," use Positioned instead. If you need more than one layer and explicit painting order, use ZStack.
A good rule is simple: use absolute_fill(...) when the child should cover everything, and use Positioned when the child should sit at a specific edge or corner.

Production checklist

For absolute_fill, review the fields that change behavior before treating the widget as finished: child. The goal is to make the product rule visible in state and actions, not hidden inside ad-hoc construction code.
If this widget appears inside an interactive flow, keep the surrounding action binding in the parent component and test that the flow still has one clear reducer path.
When child widgets are generated from data, give reordered or filtered rows an explicit WidgetId so retained local state and scroll behavior do not drift between items.
Check the semantics tree for the user-facing label or role that makes this widget understandable without relying only on pixels.
Add at least one component or harness test that confirms the visible text, semantic role, action dispatch, and layout constraint that matter for this widget in context.
If a screen starts repeating the same absolute_fill setup, extract a named component around this widget. That keeps the reference API small while making product code easier to read and safer for generated code to copy.
Overlay, Positioned, and ZStack.
Fission
A cross-platform, GPU-accelerated user interface framework for Rust. MIT licensed.
Copyright (c) 2026 Fission
Ready to use today. Widget APIs are expected to remain stable; some runtime and shell APIs may change before 1.0.0.
Fission 0.7.0