Skip to content
Noksha UIv0.1
Colour theme

overlay

Tooltip

A hover and focus label with a shared open delay, so moving between triggers stays instant.

Examples

Toolbar hints

Hover the first, then move along the row: the delay is spent once. That shared timer lives in the provider, which is why one wraps the app.

Own the source

Noksha ships as a package and as copy-paste source. Take the files and they are yours to change. These are read from the generated registry, so they are exactly what the library ships — never a paraphrase of it.

Take these files, and internal helpers along with them — the imports below point at them. Or let the CLI do it: npx @noksha-ui/cli add tooltip writes them, follows the same dependency graph, and fixes up the imports.

export {
  Tooltip,
  TooltipContent,
  TooltipProvider,
  TooltipRoot,
  TooltipTrigger,
  tooltipContentVariants,
} from './tooltip.js';
export type {
  TooltipContentProps,
  TooltipProps,
  TooltipProviderProps,
  TooltipTriggerProps,
} from './tooltip.types.js';

API reference

TooltipProviderProps

PropTypeDescription
delayDurationnumberHow long the pointer must rest before the first tooltip opens.
skipDelayDurationnumberWindow after one tooltip closes in which the next opens instantly. Scanning a toolbar should not mean waiting out the delay at every button; once the user has shown they are reading tooltips, the rest come at once.
childrenReact.ReactNode

TooltipProps

PropTypeDescription
openboolean
defaultOpenboolean
onOpenChange(open: boolean) => void
delayDurationnumber
closeDelaynumberGrace period on leaving, so a wobbling pointer does not flicker it.
interactivebooleanKeep it open while the pointer is over the tooltip itself.
childrenReact.ReactNode

TooltipTriggerProps

Also accepts everything from React.ButtonHTMLAttributes<HTMLButtonElement>.

PropTypeDescription
asChildboolean

TooltipContentProps

Also accepts everything from React.HTMLAttributes<HTMLDivElement>.

PropTypeDescription
sideSide
alignAlign
sideOffsetnumber
collisionPaddingnumber
arrowboolean
containerElement | null