Skip to content

Tooltip

Tooltips are used to provide additional information about an element when the user hovers over it. They are commonly used in forms, buttons, and other interactive elements.

Loading Code Block...
Hover me
Loading Code Block...

Adjust the `position` prop to determine where the tooltip appears relative to the trigger. Use the interactive drop-down below to test `top`, `bottom`, `left`, and `right` positions — the snippet updates to match.

Hover me
Loading Code Block...

Adjust the `alignment` prop to change where the tooltip’s arrow connects with the trigger element. Use the interactive drop-down below to test `start`, `center`, and `end` alignments — the snippet updates to match.

Hover me
Loading Code Block...

PropsDefaultTypeDescription
trigger*ReactNode (React only)Required in React: the element the user hovers/focuses to reveal the tooltip. In Vue this prop does not exist — pass the trigger element via the component's default slot instead (see Full example).
headerundefinedReact: string | ReactNode · Vue: stringBold heading shown at the top of the tooltip panel. Optional in both frameworks. React accepts arbitrary nodes (JSX, fragments, icons); Vue interpolates with `{{ }}` and only supports plain strings.
subtextundefinedReact: string | ReactNode · Vue: stringSecondary descriptive text rendered below the header. React accepts arbitrary nodes; Vue accepts strings only.
position'top''top' | 'right' | 'bottom' | 'left'Side of the trigger the panel and arrow are anchored to.
alignment'start''start' | 'center' | 'end'How the panel is aligned along the trigger axis when `position` is `top` or `bottom`. Ignored on horizontal positions, which always center vertically.
showArrowtruebooleanWhether to render the small triangular arrow that points at the trigger.
bgColor'bg-black'stringBackground of the tooltip panel and arrow. Accepts hex (`#000000`), Tailwind background utilities (`bg-blue-500`) or theme tokens (`theme-bg-accent`).
headerColor'text-white'stringColor of the header text. Accepts hex (`#ffffff`), Tailwind foreground utilities (`text-blue-500`) or theme tokens (`theme-text-accent`).
subtextColor'text-white'stringColor of the subtext. Accepts the same value formats as `headerColor`.
  • The trigger wrapper is linked to the tooltip panel via aria-describedby, so screen readers announce the tooltip content alongside the trigger.
  • The panel itself has role="tooltip".
  • Visibility is driven purely by CSS (group-hover and group-focus-within), so the tooltip surfaces both on mouse hover and on keyboard focus of any focusable element inside the trigger.
  • The component does not currently dismiss on Esc; if your trigger contains a focusable control, blurring it (e.g. Tab away or Shift+Tab) will hide the tooltip.