use ui::tooltip::Tooltip;
div()
.id("copy")
.tooltip(|window, cx| Tooltip::with_keystroke("Copy path", "⌘C", window, cx))
.child(copy_icon)- The element needs an
.id(..). Tooltip::textis the label alone.for_actionreads the chord off the keymap and drops it when nothing is bound.- The delay is gpui's:
.tooltip_show_delay(..)on the element.