Tooltip

Tooltips clarify controls or compact metadata without carrying essential meaning.

Overview and decision boundary

Use Tooltip to clarify compact controls or truncated metadata.

Do not put buttons, links, or critical content inside Tooltip.

import { Button, Tooltip, TooltipProvider } from '@nerio-ui/ui/client';<TooltipProvider>  <Tooltip label="Copies the share link"><Button>Copy link</Button></Tooltip>  <Tooltip label="Opens settings"><Button>Settings</Button></Tooltip></TooltipProvider>

Installation and imports

Install the editable registry source, or use the matching package entrypoint when the product keeps Nerio as a workspace dependency.

pnpm exec nerio add tooltipimport { Button, Tooltip, TooltipProvider } from '@nerio-ui/ui/client';

Usage

import { Button, Tooltip, TooltipProvider } from '@nerio-ui/ui/client';<TooltipProvider>  <Tooltip label="Copies the share link"><Button>Copy link</Button></Tooltip>  <Tooltip label="Opens settings"><Button>Settings</Button></Tooltip></TooltipProvider>

Variants

VariantPurpose
DefaultSmall text label in the overlay layer.

Anatomy

SlotPurpose
contentShort non-interactive explanation.
arrowClipped continuation of the overlay surface pointing back to the trigger.

States

StatePurpose
VisibleAppears on hover or focus after a short delay.
HiddenDismisses when trigger loses hover or focus.

Motion

  • State changes should use shared motion tokens and preserve reduced-motion behavior.

Accessibility

  • Uses the Base UI Tooltip primitive.
  • The arrow stays inside the popup and clips its bordered overlay surface toward the trigger.
  • The arrow is shown by default and can be omitted with showArrow when a plain floating label is more appropriate.
  • Do not put required information only inside a tooltip.
  • Keep tooltip text short and specific.
  • Requires an element trigger. Use a keyboard-focusable control when keyboard users need to discover the tooltip.
  • Supports hover and keyboard focus behavior through Base UI, plus controlled open and disabled states when needed.
  • The optional side preference accepts physical or logical placement and retains Base UI collision handling.
  • The optional sideOffset controls the trigger-to-surface distance and can keep an arrow clear of a containing navigation edge.
  • Wrap adjacent tooltip triggers in TooltipProvider so their open and close delays are coordinated.

Review the shared responsibility and evidence boundaries in the Accessibility foundation alongside this component-specific contract. Use the Spacing & layout foundation for shared density, wrapping, overflow, reflow, and component-versus-product ownership guidance. The Color foundation, Typography foundation, and Localization foundation define the shared visual-role, text-resilience, direction, and locale boundaries used by component examples.

API

PropPurpose
labelShort non-essential explanatory content.
childrenRequired trigger element; prefer a keyboard-focusable control.
disabledPrevents tooltip display while preserving the trigger.
showArrowShows the directional arrow by default; disable it when the positioned surface should remain visually detached from its trigger.
sidePreferred physical or logical side of the trigger; collision handling may adjust it when space is constrained.
sideOffsetDistance in pixels between the trigger and positioned surface; increase it when an arrow must clear a containing navigation edge.
TooltipProviderCoordinates open and close delays across a group of adjacent tooltip triggers.

Implementation contract

ContractValue
Registry itemtooltip installs 8 source files into the configured components directory.
Base UItooltip
Registry dependenciesNone.
Package dependencies@base-ui/react, clsx, react, tailwind-merge, tailwindcss

Styling contract

ContractValue
AuthoringComplete, statically detectable Tailwind CSS v4 recipes own component visuals.
ValuesSemantic and component --n-* variables remain the canonical customization layer.
OverridesCustomizable slots merge consumer className values with tailwindCn so conflicting utilities resolve deterministically.
Residual CSSOnly shared keyframes and scoped no-Preflight compatibility rules remain; there is no parallel visual selector layer.

Design notes

  • Use Tooltip to clarify compact controls or truncated metadata.

Do / do not

Do

Use to name icon-only actions or clarify dense metadata.

Place compact navigation tooltips outward from the navigation surface so they do not cover adjacent actions.

Do not

Do not put buttons, links, or critical content inside Tooltip.

Tokens

These are the primary customization points. Override semantic or component tokens instead of changing component source.

TokenPurpose
--n-tooltip-radiusPublic customization point for this component contract.
--n-overlay-z-indexPublic customization point for this component contract.
--n-overlay-floating-z-indexPublic customization point for this component contract.
--n-overlay-glass-backgroundPublic customization point for this component contract.
--n-overlay-glass-border-widthPublic customization point for this component contract.
--n-overlay-glass-borderPublic customization point for this component contract.
--n-overlay-glass-foregroundPublic customization point for this component contract.
--n-overlay-surface-filterPublic customization point for this component contract.
--n-overlay-glass-shadowPublic customization point for this component contract.
--n-motion-overlay-enter-durationPublic customization point for this component contract.
--n-motion-overlay-enter-easingPublic customization point for this component contract.
--n-motion-overlay-exit-durationPublic customization point for this component contract.
--n-motion-overlay-exit-easingPublic customization point for this component contract.