Skip to content
Ballpoint

Tooltip

A word or two on a tab shaded solid with the pen, with a little tail pointing at what it's about.

From shadcn/ui
Built on Base UI Tooltip

Installation

pnpm dlx shadcn@latest add @ballpoint/tooltip

Usage

tsx
import { Button } from "@/components/ui/button"
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "@/components/ui/tooltip"

<TooltipProvider>
  <Tooltip>
    <TooltipTrigger render={<Button variant="outline" />}>Hover me</TooltipTrigger>
    <TooltipContent>Saved to your notebook</TooltipContent>
  </Tooltip>
</TooltipProvider>

Examples

Sides

Which edge of the trigger the tooltip opens on.

With a shortcut

Name a tool and show the key that triggers it.

Toolbar

Icon buttons that name themselves, with the key beside the name.

On a disabled button

Disabled buttons take no pointer events, so the tip hangs off a wrapper that is focusable.

API reference

TooltipProvider delay
default 0
number

ms before a tooltip opens. Tooltips under one provider open instantly after the first.

side
default "top"
"top" | "right" | "bottom" | "left" | "inline-start" | "inline-end"

On TooltipContent: which side of the trigger it shows on.

align / sideOffset / alignOffset
default "center" / 8 / 0
string / number

Placement along that side, in px.

seed
string | number

Pins the drawing.

Every other prop goes to Base UI's Tooltip.

Pen settings

The drawing also takes roughness, radius and weight, as props or from the nearest InkProvider. What each one does.