Headless overlay primitives for Svelte 5. Attach tooltips, menus and dialogs to your own markup. Surfaces use native browser top-layer positioning, with optional themes.
Documentation and live demos · Installation · Release notes
pnpm add @sv-layer/tooltip<script lang="ts">
import { tooltip } from "@sv-layer/tooltip";
import "@sv-layer/tooltip/theme.css";
</script>
<button {@attach tooltip("Save changes")}>Save</button>The six attachment packages require Svelte 5.29+ and a browser with the native Popover API. The shared engine is installed automatically. It also supports direct use from Svelte 5.0. Theme CSS is optional. Custom styles for a portaled surface should use a global selector or an explicit class.
| Package | Use it for |
|---|---|
@sv-layer/tooltip |
Text hints on hover or keyboard focus |
@sv-layer/hovercard |
Interactive hover and focus previews |
@sv-layer/popover |
Click-driven panels, filters and forms |
@sv-layer/dropdown |
Action menus with arrow keys and typeahead |
@sv-layer/context-menu |
Right-click, long-press and nested menus |
@sv-layer/modal |
Focus-trapped dialogs and alerts |
See runnable examples and the core package.
Use Node.js 24 and the pnpm version pinned in package.json.
pnpm install --frozen-lockfile
pnpm build
pnpm check
pnpm test:unit
pnpm test:types
pnpm test:deliveryWith the Playwright browsers installed, run pnpm test:e2e --project chromium, --project firefox or --project webkit.