Back to Shark UI

Hint

docs/components/hint

latest6.8 KB
Original Source

Sections

Components

Utilities

Forms

Hooks

Hint

Copy Markdown

Minimal tooltip for showing information.

For the full Tooltip component, check out the Tooltip component.

PreviewCode

Hover

Installation#

CLIManual

pnpmbunnpmyarn

pnpm dlx shadcn@latest add @shark/hint

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.

PreviewCode

Hover/Click to show hint Show hint

Examples#

Positions#

PreviewCode

Left

Top

Bottom

Right

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-

[

Previous page

Frame ](/docs/components/frame)[

Next page

Hover Card ](/docs/components/hover-card)

On This Page

InstallationAnatomyUsageHint vs TooltipControlledExamplesPositionsAPI ReferenceHintHintTriggerHintContentHintArrow