Tooltip

A tooltip displays contextual information when hovering over or focusing on an element.

Anatomy

<script>
  import { Tooltip } from "@saas-ui/svelte/components/tooltip";
</script>

<Tooltip content="Tooltip text">
  <Button>Hover me</Button>
</Tooltip>

Examples

Arrow Accessibility

Use showArrow to display an arrow pointing to the trigger.

Basic Accessibility

Basic tooltip on hover.

Custom Content Accessibility

Use the trigger and children snippets for custom content.

Delays Accessibility

Use openDelay to add a delay before showing.

Disabled Accessibility

Use disabled to prevent the tooltip from showing.

Interactive Accessibility

Use interactive to allow hovering over the tooltip content.

Inverted Accessibility

Use variant="inverted" for a dark tooltip (inverted from the default light panel style).

Offset Accessibility

Use custom offset for precise positioning.

Placements Accessibility

Use the positioning prop to control placement.

Props

Tooltip

A composed tooltip component that handles trigger, positioning, and content display.

Prop Type Default Description
id string auto-generated The unique identifier for the tooltip. If not provided, a unique ID will be auto-generated.
content string | Snippet - The text content of the tooltip. Can be a string, snippet, or use children when trigger prop is provided.
children Snippet - The trigger element (default usage). When trigger prop is provided, children become the content instead.
trigger Snippet - Alternative trigger element. When provided, children become the content.
showArrow boolean false Whether to show an arrow pointing to the trigger element.
variant "default" | "inverted" "default" The visual style of the tooltip.
openDelay number 0 The delay before the tooltip opens (in ms).
closeDelay number 100 The delay before the tooltip closes (in ms).
positioning TooltipRootProps['positioning'] { placement: "bottom", strategy: "fixed" } The positioning options for the tooltip.
interactive boolean false Whether the tooltip content is interactive (can be hovered/clicked).
closeOnPointerDown boolean true Whether to close the tooltip when the trigger is clicked.
disabled boolean false Whether the tooltip is disabled.
class string - Additional CSS classes to apply.