tooltip
CSS-powered tooltip that wraps any element. No JavaScript required — the bubble appears on hover and :focus-within. Supports four placements.
tooltip({
content: 'This appears on top',
position: 'top', // top | bottom | left | right
trigger: button({ label: 'Hover me', variant: 'secondary' }),
})| Prop | Type | Default | |
|---|---|---|---|
content | string | — | Tooltip text (plain text only) |
trigger | string (HTML) | — | Raw HTML slot — the element the tooltip wraps |
position | top | bottom | left | right | top | |
class | string | — |