Pilipinas Interface

Foundation

  • Overview
  • Get Started
  • Colors
  • Typography
  • Icons
  • Layout & Spacing
  • States & Feedback
  • Motion & Transitions
  • Expressions

Components

  • Overview
  • Accordion
  • Alert
  • Avatar
  • Badge
  • Banner
  • Breadcrumb
  • Button
  • Card
  • Checkbox
  • Code Block
  • Combobox
  • Command Menu
  • Dialog
  • Popover
  • Progress
  • Radio Group
  • Scroll Area
  • Select
  • Skeleton
  • Switch
  • Table
  • Tabs
  • Text Field
  • Tooltip

Resources

  • Registry

Components

Tooltip

A short hint on hover or focus. It explains an icon or adds a shortcut; it never carries the only description of a control.

Preview
<Tooltip content="Copy reference" shortcut="⌘C">
  <Button variant="ghost" size="compact">Copy</Button>
</Tooltip>

Usage

A short hint that names an icon or shows a shortcut.

Do and don't

  • Do. Keep the control's accessible name even when a tooltip is present.
  • Don't. Put links or validation text inside the bubble.

Composition

Wrap an app region in TooltipProvider for shared timing, and a toolbar in TooltipGroup so adjacent hints open instantly after the first. Each Tooltip takes one child element and a content node. TooltipShortcut draws the key cap; TooltipPortalContainer scopes a bubble to a bounded surface.

Props

  • Tooltip: content, shortcut, side, sideOffset, delayDuration, forceOpen, followCursor, hoverable, onOpenChange.
  • TooltipProvider / TooltipGroup: delayDuration (default 200ms) and skipDelayDuration (default 300ms).

Behavior and states

The first tooltip waits for the hover delay; neighbours in a group skip it, so a toolbar feels immediate once one is open. The bubble opens on focus as well as hover. forceOpen is for composed cases such as a breadcrumb whose label is clipped; leave it undefined for normal use. A bubble stays open while the pointer is over it unless hoverable is false.

Accessibility

A tooltip is supplementary. Icon-only controls still need aria-label, and visible text must not depend on the bubble. Keep content short and non-interactive; use a popover or dialog when the user must click something inside. The shortcut cap is visual only, so the real key handling belongs to the control.

Responsive

The bubble flips between top, right, bottom and leftaccording to available space. On touch layouts, keep the control's label visible: hover hints are not the primary channel there.

Related

Button is the usual trigger, Breadcrumb uses tooltips for clipped labels, and Motion & Transitions explains the short delay and restrained entrance.

← PreviousText FieldNext →Resources

Install

npx shadcn@latest add @pilipinas/tooltip

For your coding agent