Align
Align centers one child horizontally and vertically within the space offered by its parent.
Use it for a single piece of content that needs a clear position in its parent:
an empty state, spinner, hero message, or card in a larger panel.
Use Align when centering is the main job. Do not use it for multi-child layout, for edge pinning, or for spacing between siblings. Those are better handled by Row, Column, or Positioned. Example
use fission::prelude::*;
fission_component! {
pub LoadingPanel<()>
view(_panel, _state, cx) =>
Align(Spinner(motion: SpinnerMotion::Default, label: cx.tr("loading.content")))
}
The child keeps its own natural size. Align changes where that child sits inside the parent, not what the child renders.
Field table
| | | |
|---|
| | | Defaults to None, so the runtime generates an id. |
| | | Required. Align is a single-child layout wrapper. |
Layout behavior
When the parent gives bounded width or height, Align expands to that available size and centers the child inside it. When the axis is unbounded, Align falls back to the child's size on that axis. That makes it suitable both for full-panel centering and for smaller local centering inside reusable components.
If you want the same centering behavior through a higher-level convenience widget, use Center. If you need cross-axis control in a larger layout rather than one centered child, prefer the alignment controls on Row or Column. Specific advice
An extra row of spacers makes centering depend on their flex constraints.
Align expresses that relationship directly: it positions one naturally sized
child within the space the parent actually offers.
Production checklist
Verify both a bounded panel and an unbounded scroll axis; they do not offer
the same space to centre within.
Check increased text scale and a child wider than the available parent.
Keep the child's semantics and input behaviour; centering should not add
another focus stop.