Tooltip

Displays a tooltip that can be used to display a message to the user.

Overview

The Tooltip component displays helpful information or context when users hover over or focus on an element, providing a non-intrusive way to show additional details without cluttering the interface.

Usage

import {
  Tooltip,
  TooltipContent,
  TooltipTrigger,
  Button,
} from "@tilt-legal/cubitt-components/primitives";
<Tooltip delay={400}>
  <TooltipTrigger>
    <Button variant="secondary">Hover me</Button>
  </TooltipTrigger>
  <TooltipContent>
    <p>This is a tooltip</p>
  </TooltipContent>
</Tooltip>

Tooltips show immediately by default. Pass delay={number} (milliseconds) to Tooltip to debounce hover interactions.

Examples

Basic text tooltip

Icon-only controls with hover delay

Use the delay prop to soften frequent hover interactions, especially in icon rows.

API Reference

Tooltip

PropTypeDescription
delaynumberTime in milliseconds before the tooltip opens. Defaults to 0.
openbooleanControlled open state.
defaultOpenbooleanInitial open state when uncontrolled.
onOpenChange(open: boolean) => voidCallback fired when the open state changes.
disabledbooleanPrevents the tooltip from showing.
animatedbooleanEnables or disables the default open/close animation.
classNamestringAdditional classes passed to the tooltip root.

TooltipTrigger

PropTypeDescription
renderReact.ReactElementThe element that receives hover/focus events (e.g., a Button).
classNamestringAdditional classes for the trigger wrapper.

TooltipContent

PropTypeDescription
side"top" | "right" | "bottom" | "left"Placement relative to the trigger.
sideOffsetnumberGap between the trigger and tooltip. Defaults to 8.
align"start" | "center" | "end"Alignment relative to the trigger.
alignOffsetnumberOffset adjustment for align.
classNamestringAdditional classes for the popup surface.

TooltipProvider

PropTypeDescription
delaynumberDefault delay applied to nested tooltips (milliseconds).

Wrap a subtree in TooltipProvider to set a global delay without passing it to every Tooltip.

On this page