Text-only tooltip shown from a trigger on hover or focus.
Install @wyrd-company/react or the Flutter package and use it directly —
your DESIGN.md does the styling.
catalog/contracts/tooltip.ymlsource of truth · verbatim
$schema: https://thewyrdingway.dev/schemas/component-contract.schema.ymlcontractVersion: 0.1.0identity:name: Tooltiptag: wyrd-tooltippackage: wyrd.component.tooltiptitle: Tooltipsummary: Text-only tooltip shown from a trigger on hover or focus.relationships:related-to: - quality-parity-and-gatesclassification:category: overlaycomposition: single-slotinteractive: truetarget-strategy:react: requiredflutter: requiredsurface:properties: - name: texttype:kind: stringrequired: trueserializable: truesummary: Tooltip message text. - name: placementtype:kind: enumvalues: - top - bottom - start - endrequired: falsedefault: topreflects: trueserializable: truesummary: Preferred tooltip placement relative to the trigger.slots: - name: contentrequired: truecardinality: exactly-oneaccepts: - componentsummary: Trigger component that receives the tooltip description relationship.events: []states: - name: hiddensource: behavior-runtimesummary: Tooltip is not visible. - name: visiblesource: behavior-runtimesummary: Tooltip is visible when the trigger is hovered or focus remains within the wrapper, unless Escape dismissed it.parts: - name: rootsummary: Positioning wrapper.slots: - content - name: triggersummary: Trigger wrapper.slots: - content - name: tooltipsummary: Tooltip message surface.tokens:background: color.on-surfaceforeground: color.surfaceradius: rounded.smoffset: spacing.xsmessages: []obligations:accessibility:role: tooltipname: Text property provides the tooltip message.keyboard: - Tab moves focus to the trigger according to the trigger component. - Escape dismisses a visible tooltip without moving focus.semantics: - Web projections expose role=tooltip on the tooltip element. - The tooltip text is exposed as the trigger's accessible description; light-DOM tooltip targets may use IDREF association, while shadow-root tooltip surfaces use a string description on the light-DOM trigger. - Tooltip content is not focusable. - Flutter uses Material Tooltip; bottom maps to preferBelow=true and top/start/end are approximate.behavior:model: overlayinteractions: - The tooltip is visible when hovered or focus remains within the trigger wrapper, unless it has been dismissed. - Escape dismisses a visible tooltip without moving focus. - Dismissed state clears on the next mouseenter or focusin. - The tooltip hides when neither hovered nor focus-within, or while dismissed. - Positioning uses the package anchoring utility with fixed coordinates, flip, shift, and RTL-aware start/end placement.hostEffects: - Recompute fixed coordinates when the tooltip opens and while visible on capture-phase scroll and viewport resize. - Anchor tracking during layout animations is not guaranteed in v1.conditions: - rtl - reduced-motion - cvd-deuteranopia - density-compact - text-expansionsdui:status: serializableserializableProperties: - text - placementserializableSlots: - contenteventBindings: []notes: Tooltip serializes text, preferred placement, and one trigger component. Web projections use collision-aware fixed positioning through the hand-written package positioning utility, so overflow and clipping ancestors do not clip the tooltip surface. V1 does not continuously track anchors during layout animations.examples: - name: topstate: hiddenproperties:text: More optionsplacement: topslots:content: Options - name: bottomstate: hiddenproperties:text: Save the current draftplacement: bottomslots:content: Save - name: endstate: hiddenproperties:text: Opens in a new panelplacement: endslots:content: Detailsoverrides:react:slots:content: childrenflutter:slots:content: child
01
Examples
Generated from the contract's examples block.
Previews are the published @wyrd-company/react component, themed by the
brand's role tokens — flip the site's light/dark toggle and they follow.
import { WyrdTooltip } from"@wyrd-company/react";
<WyrdTooltip text="Save the current draft" placement="bottom">
Save
</WyrdTooltip>
import'package:wyrd_flutter/wyrd_flutter.dart';
WyrdTooltip(
text: 'Save the current draft',
placement: 'bottom',
child: Text('Save'),
)
endstate: hidden
DetailsOpens in a new panel
Usage
import { WyrdTooltip } from"@wyrd-company/react";
<WyrdTooltip text="Opens in a new panel" placement="end">
Details
</WyrdTooltip>
import'package:wyrd_flutter/wyrd_flutter.dart';
WyrdTooltip(
text: 'Opens in a new panel',
placement: 'end',
child: Text('Details'),
)
02
Properties
Name
Type
Default
Summary
text
string
undefined
Tooltip message text.
placement
top | bottom | start | end
top
Preferred tooltip placement relative to the trigger.
03
Slots & events
Slot
Cardinality
Accepts
Summary
content
exactly-one
component
Trigger component that receives the tooltip description relationship.
04
Tokens
The contract's token bindings. Open the shared contextual sidebar from any example;
primary swatches reflect the color you pick there. Error swatches show the active
preset's values; editing any knob switches to custom and resets error to TWW · Ink.
Binding
Token
background
color.on-surface
foreground
color.surface
radius
rounded.sm
offset
spacing.xs
05
States
State
Source
Summary
hidden
behavior-runtime
Tooltip is not visible.
visible
behavior-runtime
Tooltip is visible when the trigger is hovered or focus remains within the wrapper, unless Escape dismissed it.
06
Accessibility
From the contract's accessibility obligations. Role tooltip; Text property provides the tooltip message.
Tab moves focus to the trigger according to the trigger component.
Escape dismisses a visible tooltip without moving focus.
Web projections expose role=tooltip on the tooltip element.
The tooltip text is exposed as the trigger's accessible description; light-DOM tooltip targets may use IDREF association, while shadow-root tooltip surfaces use a string description on the light-DOM trigger.
Tooltip content is not focusable.
Flutter uses Material Tooltip; bottom maps to preferBelow=true and top/start/end are approximate.
Status: serializable. Tooltip serializes text, preferred placement, and one trigger component. Web projections use collision-aware fixed positioning through the hand-written package positioning utility, so overflow and clipping ancestors do not clip the tooltip surface. V1 does not continuously track anchors during layout animations.