Aliases
hint
components / tooltip
Non-interactive floating hint surface with anchored containment and restrained motion.
Playground
Start here. Switch systems, interact with the shipped component, and let the rest of the page answer the why and how after the behavior clicks.
Cobalt
The crisp default DK action system: bright primary, roomy spacing, and a direct editorial rhythm.
Stage tooltip: closed
Overview
This section explains the intent of the component before the implementation details.
Aliases
hint
Explore the math
Decision guide
Use these notes to decide quickly whether this is the right DK component for the job.
Decision guide
Do
Do not
Usage
Prefer these situations when choosing this component.
Usage
These patterns are better served by a different component or a simpler surface.
Anti-patterns
Migration notes
Anatomy
The anatomy explains which pieces matter to the recipe and accessibility model.
hover/focus target
triggerThe control that reveals the tooltip.
advisory hint surface
surfaceCompact non-interactive floating shell.
API
The docs contract distinguishes props, DOM events, and slots so integration behavior is explicit.
Props
| Name | Type | Default | Description |
|---|---|---|---|
content | string | — | Tooltip text content. |
open | boolean | false | Controlled open state. |
placement | 'top' | 'right' | 'bottom' | 'left' | 'top' | Preferred anchor placement. |
delayMs | number | 300 | Open delay before the tooltip appears. |
disabled | boolean | false | Disables tooltip behavior. |
onOpenChange | (detail: { open: boolean }) => void | — | Callback fired when the tooltip opens or closes. |
theme | ThemeContract | — | Overrides the compiled DK theme used to resolve tokens and recipes for this component. |
Events
| Name | Payload | Description |
|---|---|---|
openchange | { open: boolean } | Fires when an overlay-style component opens or closes through user interaction. |
Slots
| Name | Description |
|---|---|
default | Trigger content. |
Recipes
These notes summarize the intended recipe surface rather than exposing raw implementation detail first.
Variants
Sizes
States
Accessibility
This is the behavior the component promises to assistive tech and keyboard users today.
Semantics
Keyboard
Screen readers
Caveats
Checklist
Implementation
This section shows the representative compiled slot variables that the runtime consumes for the selected design system.
Implementation notes
Implementation checklist
Examples
Each example is intentionally practical, grouped by starter, common pattern, and edge-case coverage.
Starter
1 example
starter
Starter: compact hintA short hint attached to one trigger.
Copy snippet
<Tooltip content="Quality checks passed."><button type="button">Hover the trigger</button></Tooltip>Common patterns
1 example
common
Common: alternate placementUse different placements when the surrounding layout calls for it.
Copy snippet
<Tooltip placement="right" content="Side hint"><button type="button">Hover the trigger</button></Tooltip>Edge cases
1 example
edge
Edge: controlled visibilityControl tooltip visibility only when a workflow needs deterministic open state.
Copy snippet
<Tooltip open={isOpen} onOpenChange={(detail) => isOpen = detail.open} content="Checks passed."><button type="button">Hover the trigger</button></Tooltip>Verification
Proofs stay visible in the docs so the system shows what it can guarantee, not just what it can render.