Skip to Content
⭐️ Leave a star →
ComponentsTooltip

Tooltip

Hover/focus tooltip. Configurable delay and side. Controlled and uncontrolled.

Features

Configurable delay before showing.
Supports top, bottom, left, and right sides.
Can be controlled or uncontrolled.
Shows on hover and focus.
data-state and data-side attributes for styling.

Example

Tooltip on top
import { Tooltip } from '@wire-ui/react' <Tooltip.Root delayDuration={0}> <Tooltip.Trigger> <button>Hover me</button> </Tooltip.Trigger> <Tooltip.Content side="top"> Tooltip on top </Tooltip.Content> </Tooltip.Root>

Styling

Tooltip Content receives data-state and data-side. Use them to control visibility and position-aware styling.

<Tooltip.Content className=" data-[state=closed]:hidden data-[side=top]:mb-2 data-[side=bottom]:mt-2 data-[side=left]:mr-2 data-[side=right]:ml-2 " />

Using data attributes

Content sets data-state ("open" / "closed") and data-side ("top" / "bottom" / "left" / "right").

[data-state="closed"] { display: none; } [data-side="top"] { margin-bottom: 8px; } [data-side="bottom"] { margin-top: 8px; }

Root props

PropTypeDefaultDescription
openbooleanControlled open state
defaultOpenbooleanfalseInitial state for uncontrolled use
onOpenChange(open: boolean) => voidCalled when open state changes
delayDurationnumber300Milliseconds before showing on hover

Content props

PropTypeDefaultDescription
side'top' | 'bottom' | 'left' | 'right''top'Preferred side to render

Content data attributes

AttributeValues
data-state"open" / "closed"
data-side"top" / "bottom" / "left" / "right"

Keyboard Interactions

KeyDescription
TabShows the tooltip when trigger receives focus.
EscapeCloses the tooltip.
Last updated on

MIT License © 2026 wire-ui

Tooltip – Wire UI