Skip to content

Actions & Overlays

Tooltip

A text hint shown on hover and focus.

stableEnhancer: enhanceTooltipBuilt on [role="tooltip"]hydrateless/tooltip.css

A text hint shown on hover and focus, wired with role="tooltip" and aria-describedby. The enhancer toggles visibility and dismisses on Esc.

Tooltip

Hover or focus the trigger. Focus shows it immediately; hover waits a beat.

Live

JavaScript

This component ships an optional enhancer. With auto-init it loads automatically; to wire it yourself, import it directly:

import { enhanceTooltip } from '@hydrateless/enhancers/tooltip';

const handle = enhanceTooltip(container, { placement, showDelay, hideDelay });
// handle.api  -> imperative controls
// handle.destroy()  -> tear everything down

Props

The framework bindings expose these props (and forward the rest to the root element).

PropTypeDefaultDescription
label*stringThe tooltip text.
placementstring'top'Preferred side relative to the trigger.

CSS variables

Override these on any ancestor to theme the component. See the theme studio to preview changes live.

CSS variableUsed for
--hl-fgTooltip background (inverted surface).
--hl-bgTooltip text color.
--hl-radius-smCorner radius.

Accessibility

  • The trigger is linked to the tip with aria-describedby, so it is announced on focus.
  • Focus reveals the tip instantly; Esc dismisses it without moving focus.

Released under the MIT License.