Skip to main content

container

Function container 

Source
pub fn container<'a, W, Theme>(content: W) -> Container<'a, W, Theme>
where Theme: Catalog + 'a,
Expand description

Creates a new Container with the provided content.

Containers let you align a widget inside their boundaries.

ยงExample

use iced::widget::container;

enum Message {
    // ...
}

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