Menu
Libraries |
Category

tooltips

  • A simple tooltip action and component designed for Svelte applications.
  • Provides both a Tooltip component and tooltip action for flexible usage.
  • Supports Svelte 5 via a beta package version.

Key Features:

  • Multiple trigger actions (hover, click, prop)
  • Customizable animations and positioning
  • Supports both string content and Svelte components as tooltip content
  • Theming through CSS variables or inline styles
  • Arrow visibility control and auto-positioning

Target Audience:
Svelte developers needing lightweight, customizable tooltips with component support.

Notable Svelte Support:
Primarily built for Svelte, with explicit Svelte 5 compatibility via a beta channel.

Content Flexibility:

  • Basic text content via content prop
  • Full component support through content.component with props

Theming Options:

  1. Theme class with CSS variable overrides
  2. Direct style object injection
  3. Global CSS variable overrides

Example Usage Patterns:

<!-- Component usage -->
<Tooltip content="Hello!" position="right">Hover me</Tooltip>

<!-- Action usage -->
<div use:tooltip={{ content: "Dynamic tip" }}>Interactive element</div>

<!-- Component as content -->
<span use:tooltip={{ content: { component: CustomTip, props: { text: "Hi" } } }} />

Try it in the Svelte REPL

sveltetooltipsactioncomponentsjavascriptsveltejstooltip

Comments