Module cosmic::iced_widget::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§

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

Enums§

Traits§

Functions§

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

Type Aliases§