SuperAPI AI Directory

shadcn_ui-tooltip

Frontend & websites

View repository

Updated 10-16 04:00

About this skill

Shadcn UI — Tooltip

Instructions

ShadTooltip shows a popup when the element receives keyboard focus or the mouse hovers over it. Use builder: (context) => ... to build the tooltip content (e.g. Text('Add to library')) and child for the trigger widget. Hover works only if the child uses a ShadGestureDetector; ShadButton and similar components implement it. For a plain widget (e.g. image), wrap the child with ShadGestureDetector so the tooltip shows on hover.

Basic

ShadTooltip(
  builder: (context) => const Text('Add to library'),
  child: ShadButton.outline(
    child: const Text('Hover/Focus'),
    onPressed: () {},
  ),
)

For a non-interactive child (e.g. Image), wrap with ShadGestureDetector:

ShadTooltip(
  builder: (context) => const Text('Description'),
  child: ShadGestureDetector(
    child: Image.network('...'),
  ),
)