Components / TitleBar

TitleBar

Title, actions and window buttons drawn by the app; does not move the window.

Example

The component itself, running in WebAssembly, beside its code in a playground. Try it.

Code

use ravenrs::prelude::*;

fn title_bar() -> impl View {
    let maximized = State::new(false);
    view_fn(move || {
        let toggle = maximized.clone();
        TitleBar::new("Report.pdf")
            .leading(Icon::new(IconName::File).size(16.0))
            .action(IconButton::new(IconName::Search).label("Search").size(ButtonSize::Mini))
            .maximized(maximized.get())
            .on_minimize(|| {})
            .on_maximize(move || toggle.update(|on| *on = !*on))
            .on_close(|| {})
    })
}

Open in the playground, with every example →

Full API of TitleBar →