Dinachi

Tooltip

A floating label that appears on hover or focus to provide supplementary information about an element.

#Installation

npx @dinachi/cli@latest add tooltip

#Usage

tsx
import { TooltipProvider, Tooltip, TooltipTrigger, TooltipContent } from '@/components/ui/tooltip'

#Examples

Default Tooltip

A basic tooltip on a button

Tooltip Positions

Tooltips placed on different sides of the trigger

Tooltip Variants

Default and inverse tooltip visual styles

#API Reference

PropTypeDefaultDescription
variant'default' | 'inverse''default'The visual style variant of the tooltip
openDelaynumber700The delay in milliseconds before the tooltip opens
closeDelaynumber300The delay in milliseconds before the tooltip closes
side'top' | 'right' | 'bottom' | 'left''top'The preferred side of the trigger to render the tooltip
sideOffsetnumber4The distance in pixels from the trigger
showArrowbooleantrueWhether to show the tooltip arrow pointing to the trigger