Hero Ui

Tooltip

Buttons

About

Accessible tooltip built on React Aria, from HeroUI v3. Shows informative text when users hover over or focus an element. Supports an optional arrow indicator, four placements (top/bottom/left/right), custom open/close delays, controlled offset, a disabled state, custom non-button triggers (avatars, chips, icons), custom-styled content, and a render-prop escape hatch. Compound API: Tooltip / Tooltip.Trigger / Tooltip.Content / Tooltip.Arrow, with delay, closeDelay, trigger, isDisabled, showArrow, offset and placement props.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Tooltip to your project and fits it to your theme.

Code

How Tooltip is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

"use client"

import { Info } from "lucide-react"
import { Button, Tooltip } from "@/components/ui/heroui-tooltip"

export default function Demo() {
  return (
    <div className="flex items-center justify-center gap-4 p-12">
      <Tooltip delay={0}>
        <Button variant="secondary">Hover me</Button>
        <Tooltip.Content render={(props) => <div {...props} data-custom="foo" />}>
          <p>This is a tooltip</p>
        </Tooltip.Content>
      </Tooltip>

      <Tooltip delay={0}>
        <Button isIconOnly variant="tertiary">
          <Info />
        </Button>
        <Tooltip.Content render={(props) => <div {...props} data-custom="foo" />}>
          <p>More information</p>
        </Tooltip.Content>
      </Tooltip>
    </div>
  )
}

Dependencies

More by Hero Ui

View all
  • DatePicker

    DatePicker

    470
  • Chip

    Chip

    446
  •  The Pagination

    The Pagination

    364
  • HeroUI Table

    HeroUI Table

    122
  • HeroUI Color Picker

    HeroUI Color Picker

    112
  • Skeleton

    Skeleton

    105
  • HeroUI Disclosure Group

    HeroUI Disclosure Group

    96
  • HeroUI AlertDialog

    HeroUI AlertDialog

    81

More in Buttons

View all
  • Texture Button

    Texture Button

    102
  • Button

    Button

    10
  • Button

    Button

    4
  • Native Button

    Native Button

    12
  • Button Group

    Button Group

    38
  • Button

    Button

    76
  • HeroUI Button Group

    HeroUI Button Group

    11
  • Split Button

    Split Button

    36