Skip to content
Storybook

Tooltip

Short, non-essential hint on hover and focus. Dark or Light tone.

Preview

React · live from the Storybook

HTML and CSS

The same component as plain HTML with pixels-ui.css, no framework needed.

This is a tooltip ShortcutsPress ⌘K to open the command palette.

Usage

  • Never hide essential information in a tooltip.
  • Shows after ~200ms.

Installation

Included in the core files. No extra install.

HTML
<link rel="stylesheet" href="/css/pixels-tokens.css">
<link rel="stylesheet" href="/css/pixels-ui.css">
<script src="/js/pixels-ui.js" defer></script>

Examples

Placements (static)

Top (default), Bottom and End.

TopBottomLightWith supporting text.

API reference

Class / attributeTypeDescription
px-tooltip-wrapclassWraps trigger + tooltip.
px-tooltip · --light · --bottom · --endclassTone and placement.
px-tooltip__bodyclassSupporting text.

Figma properties

Tooltip10 variants · page “Tooltip”Open

Short, non-essential hint on hover/focus. Placement is logical: Start/End flip in RTL. Show after ~300ms, never hide essential info here, and connect with aria-describedby. Use Supporting text for a 1…

PropertyTypeValues
TitleText“This is a tooltip”
Supporting textBoolean—
SupportingText“Tooltips explain an element in a sentence or two. Keep them short.”
PlacementVariantTop Bottom Start End None
ToneVariantDark Light

Design tokens

Component tokens from the Figma Component collection. Override them to restyle just this component.

TokenAliasLight value
--px-tooltip-radiusradius-md8px
--px-tooltip-padding-xspacing-md12px
--px-tooltip-padding-yspacing-sm8px

Accessibility

  • Connect with aria-describedby.
  • Opens on focus as well as hover.