Skip to Content
Overlays & Dialogs@hacline/ui/tooltip

Tooltip

Lightweight floating hint built on @ui-sdk/react/tooltip with automatic collision flipping, shortcut display, disabled-button explanations, and touch toggle support.

Import

import {
  Tooltip,
  TooltipArrow,
  TooltipContent,
  TooltipShortcut,
  TooltipTrigger,
} from "@/components/ui/hacline/components/tooltip";

Basic Usage & Shortcuts

Icon-only buttons can use type="label" to turn tooltip copy into their accessible label; pass shortcut="mod+s" with TooltipShortcut to display platform-formatted shortcuts.

Placement Sides

Specify side on TooltipContent (top, right, bottom, left); it flips automatically when viewport space is limited.

Explaining Disabled Buttons & Touch Toggling

Combine Button's disabled and focusableWhenDisabled so disabled buttons stay keyboard-focusable and surface explanations, and set toggleable on mobile info triggers to toggle on tap.

Props

Tooltip

Prop

Type

TooltipContent

Prop

Type

Data Attributes

AttributeDescription
data-slot="tooltip-content" / "tooltip-arrow"Marks the tooltip content and arrow elements
data-open / data-closedOpen or closed state
data-side / data-alignResolved placement side and alignment after collision flipping
data-starting-style / data-ending-style / data-instantEnter/exit transition and instant group switch markers