Skip to main content

Tooltip

Function Tooltip 

Source
pub fn Tooltip(props: TooltipProps) -> impl IntoView
Expand description

悬浮提示:深色小气泡,悬停 300ms 后出现,键盘聚焦触发器时立即出现。

只给图标按钮补名称或快捷键,不放可点击内容。样式见 ui.css 的 .tooltip: 只认包裹层的直接子元素,外层祖先上的悬停不会误触。

Props:

  • tip:提示文字
  • shortcut:可选的快捷键,显示在文字右侧(如 ⌘K)
  • placement:"top"(默认)/ "bottom"
  • align:"center"(默认)/ "start" / "end";触发器贴容器边缘时朝内侧对齐, 避免居中气泡被 overflow-hidden 裁掉

§Required Props

§Optional Props