Wrapper
RequiredInline trigger measurement context.
spanOverlays
A brief, non-interactive description shown from pointer, focus, or touch.
TooltipTooltipPropsTooltipPositionConfigure the production component, inspect it at responsive widths, copy synchronized JSX, and share the exact state from one workspace.
This JSX stays synchronized with the controls and uses only public package APIs.
'use client';
import { Button, Tooltip } from '@ai-created/ui';
export function Example() {
return (
<Tooltip
content={"Copy link"}
delay={300}
>
<Button variant="secondary">Copy</Button>
</Tooltip>
);
}
import { Tooltip } from '@ai-created/ui';Client boundary
'use client' to the file that owns this interactive state.Replace the version placeholder with the release tag your product has reviewed.
npm install --install-links "git+https://github.com/TheMarco/ai-created-ui.git#vX.Y.Z"@import '@ai-created/ui/styles/tokens.css';
@tailwind base;
@tailwind components;
@tailwind utilities;module.exports = {
presets: [require('@ai-created/ui/tailwind-preset')],
content: [
'./src/**/*.{js,ts,jsx,tsx,mdx}',
'./node_modules/@ai-created/ui/src/**/*.{js,ts,jsx,tsx}',
],
};Named regions define what belongs to the component, what remains optional, and where semantic responsibility lives.
Inline trigger measurement context.
spanExactly one cloned focusable element.
Portalled, viewport-positioned description associated while visible.
[role=tooltip]The Figma-equivalent asset model, auto-layout, resizing, properties, slots, content bounds, localization, and governance contract.
Asset kind
component
Design library name
Components/Overlays/Tooltip
Maturity
stable
Last reviewed
2026-08-29
Canvas applicability
Publish position and visibility variants attached to an example trigger.
| Property | Type | Default | Code mapping | Options or notes |
|---|---|---|---|---|
| ContentRequired | text | Helpful information | content | No additional constraint |
| Position | variant | top | position | top, bottom, left, right |
| Delay | number | 300 | delay | No additional constraint |
| Visible preview | boolean | true | Internal interaction state; no public prop | No additional constraint |
| TriggerRequired | instance-swap | None | children | No additional constraint |
One focusable element that owns described-by state.
childrenPositioned supplemental text.
<span role="tooltip">Overflow: Wrap up to 240px; move longer guidance into persistent UI.
Tooltips are supplemental and transient.
Overflow: Wrap compound visuals in one semantic control.
Focus and described-by must have one owner.
Translatable: Content
Bubble hugs content, portals to the document, flips when the opposite side fits, and clamps within an 8px viewport inset.
No internal breakpoint
Accountable owner
Design systems overlay primitive owner
Canonical source: src/components/Tooltip.tsx
These measurements and semantic tokens define the supported visual contract. Local overrides should preserve the same hierarchy and interaction cues.
Bubble padding
12px horizontal / 6px vertical
Trigger offset
8px
Viewport inset
8px minimum
Maximum width
240px
Radius
6px
Entrance
200ms fade
--color-surfaceBubble background.
--color-borderBubble border.
--color-text2Tooltip text.
--radius-mdBubble radius.
--shadow-elevation-medium / --layer-tooltipPortalled elevation and stacking.
--motion-fastEntrance fade.
A component is not complete until its passive, interactive, disabled, and exceptional states remain understandable in both themes.
Semantics, accessible naming, keyboard behavior, focus and announcements are implementation requirements, not optional documentation.
Use the public package API and preserve the controlled-state, native-attribute, and ref contracts described below.
import { Tooltip } from '@ai-created/ui';Client Component required
<Tooltip content="Copy link"><Button variant="icon" aria-label="Copy link">...</Button></Tooltip>These props and helpers are compatibility contracts. Changes require migration guidance and release notes.
| Prop | Type | Default | Contract |
|---|---|---|---|
| content | string | required | Tooltip text. |
| position | TooltipPosition | top | top, bottom, left, or right. |
| delay | number | 300 | Show delay in milliseconds. |
| children | ReactElement | required | Trigger element. |
| className | string | undefined | Additional tooltip classes. |
These rules keep the component recognizable across products without preventing deliberate composition.
The component should be verified as rendered UI, an interaction model, an accessibility surface, and a theme-aware visual artifact.