Module button

Source
Expand description

Buttons allow your users to perform actions by pressing them.

§Example

use iced::widget::button;

#[derive(Clone)]
enum Message {
    ButtonPressed,
}

fn view(state: &State) -> Element<'_, Message> {
    button("Press me!").on_press(Message::ButtonPressed).into()
}

Allow your users to perform actions by pressing a button.

Structs§

Button
A generic widget that produces a message when pressed.
Style
The style of a button.

Enums§

Status
The possible status of a Button.

Traits§

Catalog
The theme catalog of a Button.

Functions§

danger
A danger button; denoting a destructive action.
focus
Produces a Task that focuses the Button with the given Id.
primary
A primary button; denoting a main action.
secondary
A secondary button; denoting a complementary action.
success
A success button; denoting a good outcome.
text
A text button; useful for links.

Type Aliases§

StyleFn
A styling function for a Button.