Top
data-side="top" — default placement above the trigger.
Appears above
Short hover and focus hint linked with aria-describedby — not
title.
Live
<span class="ui-tooltip">
<button type="button" class="btn btn-primary ui-tooltip__trigger"
aria-describedby="tip-save">Save draft</button>
<span id="tip-save" role="tooltip" class="ui-tooltip__content"
data-side="top" hidden>Saves the tailored packet locally.</span>
</span>
import { Tooltip } from 'caustica-design/core'
<Tooltip content="Saves the tailored packet locally.">
<button type="button" className="btn btn-primary">Save draft</button>
</Tooltip>
data-side="top" — default placement above the trigger.
data-side="bottom" — placement below the trigger.
role="tooltip" and is linked with
aria-describedby while open — avoid native title.
| Class | Description |
|---|---|
.ui-tooltip |
Positioning root. |
.ui-tooltip__trigger |
Hover / focus target wrapper or element. |
.ui-tooltip__content |
Tooltip bubble; use data-side and hidden. |
From src/core/Tooltip.tsx.
| Prop | Type | Default | Description |
|---|---|---|---|
content |
ReactNode |
— | Accessible tooltip text (required). |
delay |
number |
400 |
Show delay in milliseconds. |
side |
'top' | 'bottom' |
'top' |
Placement relative to the trigger. |
asChild |
boolean |
false |
Merge listeners onto a single child instead of a span wrapper. |
id |
string |
auto | Id for the tooltip content element. |
className |
string |
— | Merged onto the root. |