Skip to content

TXT-002b Open tooltips on focus too, and keep what people need on the page

Level
Rule
Verdict
Unanimous (2 of 2)
Area
Text
Status
decided, version 1.0.2

Rule

A tooltip opens when its trigger gets keyboard focus, not only when the pointer rests on it. It holds only extra help. Anything the person needs to finish the task is visible on the page without hovering or focusing.

Examples

Live examples built with Justified's components. Try them with the mouse, the keyboard or a screen reader.

Do: The deadline is on the card

Table for 2, Friday 7 pm

The Copper Pot, 14 Mill Street

You can change this booking until 6 pm the day before.

The card itself says until when the booking can be changed. Tab to the info button next to the heading, or rest the pointer on it: the tooltip opens and adds a detail the person can do without.

Don't: The deadline only in a tooltip

Table for 2, Friday 7 pm

The Copper Pot, 14 Mill Street

Nothing on the card says until when the booking can be changed. That is only in the tooltip on the info button, which opens on focus and hover. Touch screens have no hover, and many people never think to look.

Why

A tooltip that only opens on hover does not exist for someone who uses a keyboard, and touch screens have no hover at all. Tooltips are also easy to miss and gone the moment the person moves on, so they must remember what it said. That is fine for a hint they can do without. It fails when the hint is the only place that says how to finish. Opening on focus supports WCAG 2.2, 2.1.1 Keyboard, which asks that all functionality works from a keyboard. We record 2.1.1 as support, not as a requirement, so this rule rests on the judges. How the tooltip closes, stays and can be hovered is set by TXT-002a.

Do

  • An icon button with the accessible name "Share" shows the tooltip "Share" both when the pointer rests on it and when the person Tabs to it.
  • The term Net amount in an invoice summary has a tooltip "The total before tax". The term can take focus, so a keyboard user can open the tooltip as well.
  • A field Project code shows "Six letters or digits, for example KX4721" as text under the field. A tooltip on the label could add where to find the code, but the format stays on the page.
  • A chart's data point shows its exact value in a tooltip, and the same values are in a table or a list next to the chart.
  • If you use shadcn's Tooltip, check in your own build that the tooltip appears when you Tab to the trigger, and that the trigger can take focus, for example a Button rather than a plain span.

Don't

  • Show a tooltip only on mouse hover, so Tab reaches the button but no help appears.
  • Put the only note that a booking cannot be changed after 6 pm the day before in a tooltip on an info icon.
  • Put the only explanation of a price or a deadline the person must act on in a tooltip.
  • Add a tooltip to a word that cannot take focus, so only pointer users can open it.

Exceptions

  • The name of an icon-only button. A tooltip on an icon-only button may show its name, in the same words as its accessible name, such as the tooltip "Share" on a button named "Share". The accessible name itself is set on the button, as ACT-001b says.
  • Other rules cover these cases. Field errors follow FRM-002a, the reason a button is unavailable follows ACT-005, the meaning of a required marker follows FRM-005, and labels follow FRM-001.
  • Actions, not information. This rule covers information. Actions that appear on hover, such as row buttons, are covered by KBD-001, and in a table row by TBL-003.
  • The full text of a truncated label. A tooltip may show text cut off by an ellipsis only on the terms LAY-003a and LAY-003b set.
  • Not decided here. Whether a tooltip may hold links or buttons is not covered by this rule.

Verdict

Unanimous (2 of 2). Only the judges decide; the expert witnesses are shown but do not vote. How verdicts work

Stances on TXT-002b
SourceRoleStancePage
WCAG 2.2LawSupports2.1.1 Keyboard
Material DesignJudge SupportsTooltips: guidelines
Tooltips: accessibility
Apple Human Interface GuidelinesJudge No position
Carbon Design SystemJudge SupportsTooltip: usage
Tooltip: accessibility
GOV.UK Design SystemExpert witness No position
Nielsen Norman GroupExpert witness SupportsTooltip Guidelines, by Alita Kendrick

Each stance links to the page it rests on, read on the date in the source register. This page never repeats what a source says; read the source itself.

History

  • Version 1.0.2, : Points to LAY-003a and LAY-003b for a tooltip that shows truncated text.
  • Version 1.0.1, : Points to TBL-003 for actions that appear on hover in a table row.
  • Version 1.0.0, : First version.

Last checked against the other rules for conflicts on .

More in Text: 4 rules and 0 guidelines · All rules