Skip to content

Search

Start typing to search.


Show all pages

Documentation

overlays

Tooltip

A short description of a control that appears on hover and keyboard focus.

Rich widgetNeeds a script for its behavior.

Usage

Wrap the trigger and the tooltip in ca-tooltip. The trigger points at the tooltip with aria-describedby.

Anyone with the link can see the lesson
HTML

Examples

On an icon button

An icon button names itself with aria-label; the tooltip shows the same words for sighted people.

Print the schedule
HTML

Guidance and accessibility

When to use

  • Use a tooltip for a short hint about a control, such as what an icon button does or what a setting changes.
  • Never put information people need only in a tooltip: touch screens have no hover. Anything essential belongs on the page.
  • Keep it to one short sentence without links or buttons. For interactive content, use a popover.

Accessibility

  • The tooltip shows while the pointer is over the trigger or the tooltip, and while the trigger has keyboard focus. People can move the pointer onto it without it closing.
  • Escape hides it without moving focus or the pointer (WCAG 1.4.13); this needs ca-tooltip.js. Without the script it still shows and hides with hover and focus.
  • Connect it with aria-describedby, so screen readers read it after the trigger’s name.
  • It opens above the trigger and does not flip, so leave room above triggers near the top of a scrolling container.

Classes

Generated from the component contract. Parts use __, modifiers use --.

Classes of the tooltip component
ClassKindUse it for
ca-tooltipComponentWrapper around the trigger and its tooltip.
ca-tooltip__contentPartThe role="tooltip" text, shown centered above the trigger.

Skins

The same markup, dressed by each skin. Structure and behavior stay the same; only the look changes.

Base skin

Neutral grayscale starting point; product skins extend it and change what differs.

Anyone with the link can see the lesson

Calaca skin

The Calaca UI brand: hueso paper and tinta ink, cempasúchil marigold, rosa and jade.

Anyone with the link can see the lesson

Proof skin

Pilot skin pushed far from base: square, heavy, offset shadows, larger targets.

Anyone with the link can see the lesson

Crossview skin

The CrossView proofing table: cool ground, bond-paper sheets, rule-grey hairlines, one red mark.

Anyone with the link can see the lesson

Framework notes

Link the prebuilt stylesheet of your skin next to your brand theme. No build step.

HTML
<link rel="stylesheet" href="theme.css" />
<link rel="stylesheet" href="ca-base.css" />