Module container

Source
Expand description

Containers let you align a widget inside their boundaries.

§Example

use iced::widget::container;

enum Message {
    // ...
}

fn view(state: &State) -> Element<'_, Message> {
    container("This text is centered inside a rounded box!")
        .padding(10)
        .center(800)
        .style(container::rounded_box)
        .into()
}

Structs§

Container
A widget that aligns its contents inside of its boundaries.
Id
The identifier of a Container.
Style
The appearance of a container.

Traits§

Catalog
The theme catalog of a Container.

Functions§

background
A Container with the given Background.
bordered_box
A bordered Container with a background.
danger
A Container with a danger background color.
dark
A Container with a dark background and white text.
draw_background
Draws the background of a Container given its Style and its bounds.
layout
Computes the layout of a Container.
primary
A Container with a primary background color.
rounded_box
A rounded Container with a background.
secondary
A Container with a secondary background color.
success
A Container with a success background color.
transparent
A transparent Container.
visible_bounds
Produces a Task that queries the visible screen bounds of the Container with the given Id.

Type Aliases§

StyleFn
A styling function for a Container.