pub fn tooltip<W, V>(content: W, tooltip: V) -> Tooltip<W, V>Expand description
Creates a new Tooltip for the provided content with the given
Widget.
Tooltips display a hint of information over some element when hovered.
By default, the tooltip is positioned crate::tooltip::Position::Auto;
use the Tooltip::position method to set a specific position.
ยงExample
use iced::widget::{container, tooltip};
enum Message {
// ...
}
fn view(_state: &State) -> impl Widget<Message> {
tooltip(
"Hover me to display the tooltip!",
container("This is the tooltip contents!")
.padding(10)
.style(container::rounded_box),
)
.position(tooltip::Position::Bottom)
}