Dashral Pro is on the wayGet 30% off at launch

Dashral

Tooltip

A short hint shown on hover or keyboard focus.

$ pnpm dlx shadcn@latest add https://dashral.com/r/tooltip.json

Installation

$ pnpm dlx shadcn@latest add https://dashral.com/r/tooltip.json

Adds the component, the components it builds on, its npm packages and the theme tokens it uses. Using Dashral often? Add the registry to components.json once:

components.json
{
  "registries": {
    "@dashral": "https://dashral.com/r/{name}.json"
  }
}

Then add components by name:

$ pnpm dlx shadcn@latest add @dashral/tooltip

Usage

example.tsx
import { Link2 } from "lucide-react"
import { Button } from "@/components/dashral/button"
import { Tooltip } from "@/components/dashral/tooltip"

<Tooltip content="Copy link">
  <Button size="icon" variant="ghost" aria-label="Copy link">
    <Link2 />
  </Button>
</Tooltip>

Examples

Editor toolbar

Icon buttons named by their tooltip, with the keyboard shortcut beside the name.

API reference

Tooltip

Also takes every prop of Radix Tooltip(opens in a new tab).

PropTypeDefault
contentReactNode

What it says. Required.

—
childrenReactElement

The control it describes; it must take a ref and focus.

—
side / align

Where it shows.

"top" / "center"
delaynumber

Milliseconds the pointer rests before it opens.

0
classNamestring

The tooltip's classes.

—

Keyboard

KeysAction
TabFocusing the trigger shows it
EscapeHide it

Accessibility

  • Describes the trigger (aria-describedby). Only for short hints: no links or buttons inside, and never the only label of an icon button — give that an aria-label too.

Motion

  • Opens with a fade, a scale from 95%, a 2px blur clearing and a 4px slide from its trigger's side, on the spring (--duration-standard); closes faster (--duration-fast, --ease-exit). No blur with reduced motion.