Skip to content
Nana UI

Tooltip

A small contextual label that appears on hover or keyboard focus. Wrap the trigger in the default slot and pass the text via the content attribute (or the content slot for rich markup). Shows on hover and focus for accessibility, dismisses on Escape, and flips on the main axis when it would overflow the viewport.

Hover me
Terminal window
npm install @nana-tec/ui-components
import "@nana-tec/ui-components/tooltip";
<nana-tooltip content="Saves your changes">
<nana-button>Hover me</nana-button>
</nana-tooltip>
Top Right Bottom Left
Dark Light Success Danger Info Warning
PropertyTypeDefaultDescription
contentstring''Plain-text tooltip content. Ignored when the content slot is used.
placement'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'left-start' | 'left-end' | 'right' | 'right-start' | 'right-end''top'Where the tooltip sits relative to the trigger.
variant'dark' | 'light' | 'info' | 'success' | 'warning' | 'danger''dark'Colour theme.
size'sm' | 'md' | 'lg''md'Size scale.
trigger'hover' | 'click' | 'manual''hover'What opens the tooltip. hover also responds to keyboard focus.
openbooleanfalseOpen state (use with trigger="manual" for full control).
arrowbooleanfalseShow a pointing arrow.
disabledbooleanfalseDisable the tooltip entirely.
openDelaynumber300Delay before showing on hover/focus, in ms.
closeDelaynumber0Delay before hiding on leave/blur, in ms.
EventTypeDescription
nana-showCustomEventFired when the tooltip opens
nana-hideCustomEventFired when the tooltip closes
SlotDescription
(default)The trigger element the tooltip describes
contentRich tooltip content (overrides the content attribute)
VariableDefaultDescription
--nana-tooltip-bgBubble background
--nana-tooltip-colorBubble text colour
--nana-tooltip-max-widthMax bubble width before wrapping
PartDescription
baseThe positioning container
bodyThe tooltip bubble
arrowThe pointing arrow
triggerThe trigger wrapper
  • Keyboard accessible
  • Screen-reader labels
  • Focus-visible states
  • ARIA roles and states
  • WCAG 2.2 AA contrast
Explore Tooltip interactively Every state, prop, and edge case — with live controls — in Storybook.
View in Storybook