Tooltip
Draft shadcn presentation over the Base Tooltip family.
This page targets Shadcn Rhea and explicitly selects it for profile-aware parts. The headless trigger/action-body gap below remains open; this is not yet a fully unified Rhea demonstration. This does not change public compatibility defaults or imply complete browser, native-host or visual acceptance. Neutral Surface/Text atoms retain their own public semantics; the consumer composition supplies the family presentation theme.
This draft family contains Group, Root, Trigger, and Content. Base Tooltip remains the sole owner of open state, controlled ownership, disabled behavior, pointer and focus intent, delay and dismissal sequencing, aria-describedby, presence, Escape handling, renderer-owned Portal projection, and anchored positioning. The shadcn layer adds only Group layout, Trigger feedback, and a compact Content surface.
The historical API comparison is shadcn-ui/ui f31ed81983653919dd4fe77aee4b4859f610f1dc, apps/v4/registry/new-york-v4/ui/tooltip.tsx; it is not this page’s selected visual profile. Its Provider defaults pointer delay to 0ms; Proto UI retains Base Group’s 700ms open, 100ms close and 300ms skip. Its Content defaults sideOffset to 0; Proto UI retains 4. Portal remains renderer-owned and Arrow remains unavailable without a governed geometry channel.
Content selects the Rhea style source: inline-flex, fit-content width, a 20rem maximum, 6px gap and rounded-xl, with foreground/background theme colors inverted for the tooltip surface. The 2026-10-10 base-nova snapshot (SHA256 2f55867faecee2d3616cfd8c6a80b538909a21e62fdfa2788b1ead56093e5395) is retained only as the unscoped compatibility reference. Trigger is a headless semantic owner with existing Proto feedback, not a Button. A reusable Rhea passive action-body composition is still needed to replace the demo’s historical authored trigger paint without adding a second focus/activation owner. Arrow, transform-origin, directional motion, kbd descendant styling and native visual acceptance remain open.
Import the family from @proto.ui/prototypes-shadcn/tooltip, or generate its React facade with proto-ui add react shadcn-tooltip. Content remains supplementary, non-focusable, and non-essential; interactive task content belongs to Popover or a non-modal Dialog.
Suggested acceptance path
Section titled “Suggested acceptance path”- Hover Account and confirm the cold Tooltip opens after about 700ms; leave early and confirm no flash appears.
- Move to Notifications before the 300ms warm window expires and confirm the sibling opens immediately with one active owner.
- Tab to either Trigger and confirm immediate opening, a visible focus ring, and no button role.
- Confirm Content is portaled outside the preview frame, remains linked by
aria-describedby, and contains no focusable control or Arrow. - Press Escape and confirm Content closes while focus remains on Trigger.
- Repeat in Web Components, React, Vue, and Vue 2, in both Light and Dark.
The related entities are draft; this page describes the current cataloged direction, not a stable compatibility guarantee.
Install
Section titled “Install”
npx @proto.ui/cli@latest add wc shadcn-tooltip
Replace wc with react, vue or vue2 to generate the facade for that host.
Tooltip on a Button
Section titled “Tooltip on a Button”A focusable command and Tooltip should share one subject. Compose the draft useTooltipTrigger() authored hook with the command behavior, adapt the resulting prototype, and place that component directly inside Tooltip Root alongside Content. Do not wrap a separately focusable Button in the standalone Trigger: that creates two Tab stops.
import { definePrototype } from '@proto.ui/core';import { asButton, type ButtonProps, type ButtonExposes } from '@proto.ui/prototypes-base/button';import { useTooltipTrigger } from '@proto.ui/prototypes-base/tooltip';
export const tooltipButton = definePrototype<ButtonProps, ButtonExposes>({ name: 'app-tooltip-button', setup() { asButton(); useTooltipTrigger(); },});Button retains its role, name, click signal, disabled state and single focus owner. Tooltip adds hover/focus intent and the owned aria-describedby relation. Disabling Tooltip Root suppresses Tooltip while leaving the command available; disabling the command suppresses both. useTooltipTrigger takes no options and adds no outward exposes. It requires an existing focusable subject. Standalone asTooltipTrigger retains its original focus behavior and exposes.
For an existing styled prototype, use the same setup composition while preserving its render function: call the styled prototype’s setup(def), then useTooltipTrigger(), and return the captured render function from your definePrototype. Keep the styled prototype’s static modules declaration. This shares one host and preserves the family’s Button presentation; it is separate from the passive action-body styling used by the standalone demo below.
Passing open on Root selects controlled mode. Group delays apply when Root does not set its own.
| Prop | Type | Default |
|---|---|---|
defaultOpen | boolean | false |
disabled | boolean | false |
openDelay | number | 700 |
closeDelay | number | 100 |
skipDelay | number | 300 |
side | 'top' 'right' 'bottom' 'left' | top |
align | 'start' 'center' 'end' | center |
sideOffset | number | 4 |
alignOffset | number | 0 |
avoidCollisions | boolean | true |
collisionPadding | number | 0 |
openDelay, closeDelay, and skipDelay belong to Group. side through collisionPadding belong to Content. Trigger only adds disabled.