Skip to content
LoidoltTheme 0.11.1
Svelte 5

Component

Tooltip

A short hint attached to a control.

import { Tooltip } from '@loidolt/theme-svelte';

Example

Notes

  • Wrap the app once in TooltipProvider so 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.
  • arrow points the tooltip at its trigger.

Props

Generated from the component source, so it cannot drift from the implementation.

Tooltip props
PropTypeDefaultNotes
content required string—
align Alignment'center'
arrow booleanfalsePoint the tooltip at its trigger — worth it when the trigger is small or crowded.
class string—class lands on the portaled Content element.
delayDuration number350Ignored when an ancestor TooltipProvider is present.
onOpenChange (open: boolean) => void—
open bindablebooleanfalse
ref bindableHTMLElement | nullnull
side Placement'top'
sideOffset number6
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.