Skip to main content
PROYECTOVIVIANA

Tooltip

Tooltip shows a short, contextual description of a control on hover or keyboard focus. It is paired with its trigger through TooltipTrigger, which manages the warmup delay, positioning, and dismissal.

Import

import {
  Tooltip,
  TooltipTrigger,
  ActionButton
} from '@proyecto-viviana/solid-spectrum';

Basic

Wrap a focusable trigger and a Tooltip in a TooltipTrigger. The tooltip appears on hover after a short delay, and immediately on keyboard focus.

<TooltipTrigger>
  <ActionButton aria-label="Edit">✎</ActionButton>
  <Tooltip>Edit</Tooltip>
</TooltipTrigger>

Placement

Set placement on the trigger to control which side the tooltip prefers; it flips automatically when there is not enough room.

<TooltipTrigger placement="bottom">
  <ActionButton aria-label="Download">↓</ActionButton>
  <Tooltip>Download</Tooltip>
</TooltipTrigger>

TooltipTrigger Props

Props

PropTypeDefaultDescription
placement'top' | 'bottom' | 'start' | 'end' | 'left' | 'right''top'Preferred side of the trigger to render on; flips when space is tight
delaynumber1500Warmup delay in milliseconds before the tooltip appears on hover
isDisabledbooleanfalseWhether the tooltip is suppressed entirely
childrenJSX.ElementThe trigger element followed by a Tooltip

Tooltip Props

Props

PropTypeDefaultDescription
childrenJSX.ElementThe tooltip's text content

Accessibility

  • The tooltip renders with role="tooltip"
  • The trigger references it via aria-describedby while it is open
  • Focusing the trigger with the keyboard shows the tooltip immediately, no delay
  • Escape dismisses the tooltip while keeping focus on the trigger
  • Only one tooltip is visible at a time across the app