{"name":"tooltip","title":"Tooltip","description":"","kind":"component","category":"overlays","status":"beta","props":{"content":{"type":"string","description":"The label."},"shortcut":{"type":"string","description":"Shortcut hint, e.g. ⌘C."},"placement":{"type":"enum","values":["top","top-start","top-end","bottom","bottom-start","bottom-end","left","right"],"default":"top","description":"Preferred side; flips when there is no room."},"openDelay":{"type":"number","default":400,"description":"Milliseconds before the first tooltip opens on hover."},"disabled":{"type":"boolean","default":false},"triggerLabel":{"type":"string","description":"Renders a default Button trigger with this label. Otherwise the trigger is your own element (child / default slot / trigger snippet)."},"id":{"type":"string","description":"Machine id; generated when omitted. Set it when several React roots or Vue apps on one page each render tooltips, so their generated ids cannot collide."}},"playground":{"name":"Playground","props":{"content":"Copy deploy ID","shortcut":"⌘C","triggerLabel":"dpl_7f3a9c"}},"exampleFiles":[{"file":"comment-toolbar","title":"Formatting toolbar of a comment"},{"file":"sidebar-toggle","title":"Icon button with a shortcut"},{"file":"navigation-rail","title":"Labels for a collapsed rail"}],"worstCase":[{"name":"Long label","props":{"content":"Regenerate the answer using every source attached to this conversation, including the archived supplier exports","shortcut":"⌘⇧R","triggerLabel":"Regenerate"}},{"name":"One letter","props":{"content":"B","triggerLabel":"B"}}],"anatomy":[{"part":"root","element":"div","description":"The chip itself (data-slot=\"tooltip\"): role=tooltip, data-state=open|closed, data-instant for a neighbour, kbd-instant. Rendered in a portal on first open."},{"part":"positioner","element":"div","description":"Placed by the engine; exposes --transform-origin"},{"part":"label","element":"span"},{"part":"shortcut","element":"kbd","optional":true,"description":"Keyboard shortcut hint: the real Kbd (plain, one key holding the hint), marked data-tooltip=\"shortcut\", in the muted tooltip colour"}],"slots":{"default":"The trigger element (React child, Vue default slot). Svelte: a `trigger` snippet that spreads the props it receives. React and Vue pass any other props and listeners (with the ref) on to the trigger, so a Tooltip can be the as-child trigger of a Menu or a Dialog close button; in Svelte merge both props functions on your element.","content":"Vue: rich label instead of the content prop"},"states":["open","instant","disabled"],"tokens":["color.tooltip-bg","color.tooltip-fg","color.tooltip-muted","color.tooltip-border","radius.chip","text.xs","duration.tooltip","duration.fast","easing.out-strong","motion.popup-scale"],"a11y":{"role":"tooltip","keyboard":["Focus on the trigger (keyboard) shows the tooltip at once, with no animation","Escape hides it","Blur hides it"],"notes":["The trigger is described by the tooltip (aria-describedby) while it is open; an icon-only trigger still needs its own aria-label.","Not shown on touch: put essential information elsewhere.","Hovering from one trigger to the next skips both the delay and the animation.","A press on the trigger closes the tooltip, and cancels one still waiting out its delay (also when the trigger's own engine prevents the press's default, as a date picker's or a menu's does); none opens again until the pointer leaves."]},"motion":["chip: opacity + scale from motion.popup-scale out of the trigger (--transform-origin), duration.tooltip, easing.out-strong; closes at duration.fast","neighbour of an open tooltip: no delay, no transition (data-instant)","keyboard focus: no transition (kbd-instant)"]}