Tooltip
A tooltip is a short note about a control. It opens when a mouse hovers or a keyboard focuses the control. People can't use it like a button.
role="tooltip"A real example
When an icon button gets keyboard focus, “Copy link” appears. Focus stays on the button.
Main parts
- 01Trigger
- 02Anchored or modal surface
- 03Focus boundary
- 04Dismiss path
Use it when
Use it to explain a short control label on both mouse hover and keyboard focus.
Do not use it when
Never put actions, must-read instructions, or long content inside a tooltip.
Name used in code
role="tooltip" Before you ship
Move focus on purpose. Keep it inside only when the overlay blocks the page. Support Escape and a visible close button, then return focus to the opener. Keep entered data and check small-screen, loading, and failure states.
Outcome: Use Tooltip to solve this user need without losing the current context. User context: When an icon button gets keyboard focus, “Copy link” appears. Focus stays on the button. Recommended pattern: Tooltip. Why it fits: Use it to explain a short control label on both mouse hover and keyboard focus. Do not use it when: Never put actions, must-read instructions, or long content inside a tooltip. Product requirements: Define the default, loading, empty, error, success, and recovery states. Keep user input. Give clear feedback after every action. Accessibility and resilience: Use semantic HTML, full keyboard access, and visible focus. Make the layout work when zoomed and support reduced motion. Follow the project’s current rules. Do not add a new UI library unless the project already uses it. Acceptance criteria: The main task works with keyboard only and at 320px width. Focus and status changes are announced. Check loading, failure, retry, cancel, and reduced-motion paths. Evidence and limits (evidence boundary): The standard covers only the listed scope. It does not choose the visual style, product decision, or Vibulary example. Unknowns to confirm: Product wording, data source, analytics events, supported devices and languages, and platform limits.
Check this request
Review the current use of Tooltip. Definition: A tooltip is a short note about a control. It opens when a mouse hovers or a keyboard focuses the control. People can't use it like a button. Release checks: Move focus on purpose. Keep it inside only when the overlay blocks the page. Support Escape and a visible close button, then return focus to the opener. Keep entered data and check small-screen, loading, and failure states. Before changing code, report the evidence you found, gaps, severity, and the smallest safe fix.