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.

Preview

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

Installation and imports

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

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

Usage

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

Variants

VariantPurpose
DefaultSmall text label in the overlay layer.

Anatomy

SlotPurpose
contentShort non-interactive explanation.

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.
  • 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.

API

PropPurpose
labelShort non-essential explanatory content.
childrenRequired trigger element; prefer a keyboard-focusable control.
disabledPrevents tooltip display while preserving the trigger.

Implementation contract

ContractValue
Registry itemtooltip installs 7 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.

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-backgroundPublic customization point for this component contract.
--n-overlay-borderPublic customization point for this component contract.
--n-overlay-foregroundPublic customization point for this component contract.
--n-overlay-surface-filterPublic customization point for this component contract.
--n-overlay-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.