Controls

Tooltip

Preview
Reduced motion

Simulates prefers-reduced-motion for the demo. Off follows your system setting.

Keyboard stepping

Steps focus through the demo with ] and [. Tab, arrows, and Escape stay native so the component behaves as shipped.

Tooltip

Tooltip

A small label that grows out of an element on hover or focus.

Installation

npx shadcn@latest add ikislay/pixel-ui/tooltip

How to use

import { Tooltip } from "@/components/ui/tooltip"
export function Demo() {
return (
<Tooltip content="Copy link">
<button type="button">Share</button>
</Tooltip>
)
}

Source Code

// Loading…

Props

Options you can pass to customize this component.

Prop
Type
Description
content*
ReactNode

What the label says.

children*
ReactElement

One focusable element. It gets the hover and focus handlers and aria-describedby.

side
topbottomleftright

Where the label sits. It does not flip at the screen edge.

delay
number

Milliseconds of hover before it shows.

onFeedback
(event: "open" | "close") => void

Called at each semantic moment, for wiring sound or haptics.

className
string

Merged onto the label.