Overlays Core Stable

Tooltip

A small anchored label that explains a control on hover or focus — plain text only, never interactive content

Preview

Installation

pnpm add fancy-ui-svelte
import { Tooltip } from 'fancy-ui-svelte'

Usage

svelte
<script lang="ts">
  import { Tooltip } from 'fancy-ui-svelte';
</script>

<Tooltip />

Examples

Basic Usage

A heart IconButton with a tooltip, matching the mockup.

Sides

The tooltip placed on each of the four sides.

Delays

openDelay and closeDelay tuned away from their defaults.

Props

PropTypeDefaultDescription
content *string-The tooltip's text
side "top" | "bottom" | "left" | "right""top"Side of the trigger to place the tooltip on
align "start" | "center" | "end""center"Alignment along the trigger's cross axis
offset number6Gap in pixels between the trigger and the tooltip
openDelay number500Delay in ms before a hover opens it. Never applied to a focus open
closeDelay number0Delay in ms before it closes once neither hovered nor focused
disabled booleanfalseSuppresses it entirely — no open on hover or focus
class string-Additional CSS classes, merged onto the trigger wrapper
ref HTMLElement | nullnullBindable reference to the trigger wrapper element

Slots

SlotDescription
childrenThe trigger. Must render exactly one focusable element — a button, link, or similar