Menu

Tooltip

Contextual hint. 4 placements × 2 themes.

Installation

$ npx uix-ui@latest add tooltip

This copies the file into components/ui/tooltip.tsx in your project. npx shadcn@latest add @uix/tooltip works too.

Usage

tooltip.tsx
import { Tooltip } from "@/components/ui/tooltip";

<Tooltip content="Shows in the next 3 days">
  <Button variant="outline">Delivery</Button>
</Tooltip>

Examples

Placements

Light theme on an icon button

Props

PropTypeDefaultDescription
themedark | light"dark"
placementtop | bottom | left | right"top"
contentReact.ReactNode–

Everything else is passed to the root element, so className, aria-* and event handlers work as usual.

Dependencies

Installed for you by the CLI.

  • class-variance-authority
  • clsx
  • tailwind-merge
  • lib/utils.ts
esc

↑↓ to navigate · ↵ to select · esc to close