Components / Tooltip

Tooltip

Short label shown on hover, with an optional key cap.

Example

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

Code

use ravenrs::prelude::*;

fn tooltip() -> impl View {
    VStack::new((
        Spacer::new().min(40.0),
        HStack::new((
            Tooltip::new(Button::new("Show tip").style(ButtonStyle::Secondary), "It stays out of the way"),
            Button::new("Save").style(ButtonStyle::Secondary).tooltip("Save the file"),
            Tooltip::new(Button::new("Open").style(ButtonStyle::Secondary), "Open a file").shortcut("⌘O"),
        ))
        .spacing(8.0),
    ))
}

Open in the playground, with every example →

Full API of Tooltip →