Reference
Family - Center Y
Unified reference for the Center Y widget family across module, constructor, and element APIs.
Family - Center Y
This page unifies related iced::widget APIs for the Center Y family.
# API surfaces
- Constructor: iced::widget::center_y
# Surface summaries
# Constructor
Creates a new Container that fills all the available space vertically and centers its contents inside.
# Verified constructor signature
rust
pub fn center_y<'a, Message, Theme, Renderer>( content: impl Into<Element<'a, Message, Theme, Renderer>>, ) -> Container<'a, Message, Theme, Renderer> where Theme: Catalog + 'a, Renderer: Renderer,
# Example References
- ref/examples/clock/src/main.rs
- ref/examples/loupe/src/main.rs
- ref/examples/text/src/main.rs
- ref/examples/editor/src/main.rs
- ref/examples/pokedex/src/main.rs
- ref/examples/geometry/src/main.rs
# Inline Examples (from rustdoc)
# Constructor example
rust
let center_y = container("Vertical Center!").center_y(Fill);
# Related
# Use this when...
- You want one page that links module, constructor, and element surfaces.
- You are deciding which API surface to start from.
- You need a practical map for this widget domain.
# Minimal example
rust
// Typical flow: // 1) Start with constructor usage. // 2) Move to module docs for style/state details. // 3) Use element docs for type-level control.
# How it works
Family pages connect related docs so you do not miss capabilities that are split across constructor/module/element pages.
# Common patterns
rust
// Build with constructor APIs first, // then refine behavior/styles through related module and element docs.
# Gotchas / tips
- Family routes normalize naming; module/function/struct names may differ slightly.
- Prefer this page as your entrypoint when learning unfamiliar widgets.
- Follow example references here before inventing integration patterns.