Component
Tooltip
A short hint attached to a control.
import { Tooltip } from '@loidolt/theme-svelte';
Example
Notes
- Wrap the app once in
TooltipProviderso skip-delay grouping works across every tooltip. - The tooltip describes its trigger; it does not name it. Never put the only copy of a control’s name in one.
arrowpoints the tooltip at its trigger.
Props
Generated from the component source, so it cannot drift from the implementation.
| Prop | Type | Default | Notes |
|---|---|---|---|
content required | string | — | |
align | Alignment | 'center' | |
arrow | boolean | false | Point the tooltip at its trigger — worth it when the trigger is small or crowded. |
class | string | — | class lands on the portaled Content element. |
delayDuration | number | 350 | Ignored when an ancestor TooltipProvider is present. |
onOpenChange | (open: boolean) => void | — | |
open bindable | boolean | false | |
ref bindable | HTMLElement | null | null | |
side | Placement | 'top' | |
sideOffset | number | 6 | |
trigger | Snippet | — | |
triggerChild | Snippet<[TriggerChildProps]> | — | Full control of the trigger element — avoids nesting a button inside the trigger. |
triggerClass | string | 'ldt-button ldt-icon-button ldt-button--ghost' | |
triggerLabel | string | — | Set only when the trigger has no accessible name of its own. Bits already wires aria-describedby, so forcing an aria-label here would clobber that name. |
Plus the attributes of Omit<TooltipContentProps, 'children' | 'class' | 'child'>, forwarded to the root element.