Skip to content
shadcn.io
shadcn.io is not affiliated with official shadcn/ui

Shadcn Hint for React and Tailwind

Minimal tooltip for showing information.

Installation

bunx --bun shadcn@latest add https://kit.dev/r/hint.json

Anatomy

Hint
├── HintTrigger
└── HintContent

Usage

import { Hint, HintTrigger, HintContent } from "@/components/ui/hint";
<Hint>
  <HintTrigger />
  <HintContent />
</Hint>

Hint vs Tooltip

  • Hint: A lightweight, minimal tooltip that shows information, no external dependencies.

  • Tooltip: A more complex component that provides a more full-featured tooltip with a variety of options.

Controlled

Pass open and onOpenChange to controlled hint.

Examples

Positions

API Reference

Hint

Root wrapper. Provides hint context to trigger and content.

PropTypeDefault
openboolean-
defaultOpenbooleanfalse
onOpenChange(open: boolean) => void-
positioningPositioning"{ placement: 'top', gutter: '10px' }"
classNamestring-
AttributeTypeDefault
--gutterstring10px

HintTrigger

Shows the hint on hover or focus. Button by default; use asChild for custom elements.

PropTypeDefault
classNamestring-
asChildboolean-

HintContent

Hint content shown in a popover on hover or focus.

PropTypeDefault
lazyMountbooleantrue
unmountOnExitbooleantrue
classNamestring-
asChildboolean-

HintArrow

Arrow pointing to the trigger. Rendered inside HintContent by default.

PropTypeDefault
classNamestring-