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()
}

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.
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.
warning
A warning button; denoting a risky action.

Type Aliases§

StyleFn
A styling function for a Button.