跳到正文
UIGrammer
EN 中文

组件 · 浮层 · 33

提示气泡

提示气泡 = 距触发器 6 像素的深色小片,用于解释图标,不含链接也不接收焦点。

直达修改 Prompt

Archive prompt ⌘A
Naming an icon button

提示气泡是什么?

提示气泡为图标无法表达的东西命名。点名方位、延迟,以及「内部不放交互元素」这条规则。

变体

点击属性即可在预览中高亮。

在 Prompt 里写明这个类型。
在 Prompt 里写明这个类型。
在 Prompt 里写明这个类型。
给具体值,不要只给感觉词。
给具体值,不要只给感觉词。
给具体值,不要只给感觉词。
给具体值,不要只给感觉词。
给具体值,不要只给感觉词。

状态

点击属性即可在预览中高亮。

在 Prompt 里写明这个状态。
在 Prompt 里写明这个状态。
在 Prompt 里写明这个状态。
在 Prompt 里写明这个状态。

结构解剖

这些是 Prompt 里应该点名的部件。

  • 01 触发器
  • 02 气泡
  • 03 箭头
  • 04 文字

什么时候用

  • 为工具栏里的纯图标按钮命名
  • 在操作旁显示键盘快捷键
  • 解释某个控件为何被禁用

什么时候别用

  • 文字里有链接或按钮——改用弹出层
  • 内容超过两行
  • 主要输入方式是触摸——没有悬停

Nothing interactive goes inside a tooltip — the pointer cannot reach a link living in a chip that vanishes on hover.

Create a tooltip component. STYLE - dark chip #1D1D1F, 12px white text, 6px radius, 6px from the trigger - a 4px arrow points back at the trigger center - max width 200px, text wraps to two lines then truncates - a shortcut hint sits right-aligned in #8E8E93 STATES - hidden, 400ms hover delay, visible, dismissed on pointer leave TECHNICAL - React - Tailwind CSS - shadcn/ui