goyda 0.1.3

A Rust UI toolkit that compiles the same app to Windows, Android, and web
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use crate::components::Component;

pub struct Checkbox {
    pub label: String,
    pub checked: bool,
}

impl Checkbox {
    /// A labeled checkbox, starting `checked` or not. Listen for toggles
    /// with `.on_checked_change(...)` (see [`crate::listeners`]).
    pub fn new(label: impl Into<String>, checked: bool) -> Component {
        Component::Checkbox(Self {
            label: label.into(),
            checked,
        })
    }
}