Skip to content

Floating UI

Positioning toolkit for tooltips, popovers and anchored overlays.

ExperimentalActive

Experimental

Compatibility is possible but still being validated for production Preact use.

Package@floating-ui/dom

Facts at a glance
Preact compatibility
Experimental
Tested Preact versions
Not documented
TypeScript
Native TypeScript
SSR
SSR unsupported
Maintenance
Active
License
MIT
Last verified
Not yet verified
Terminal
npm install @floating-ui/dom
preact-example.ts
import { computePosition } from "@floating-ui/dom"; await computePosition(buttonEl, tooltipEl, { placement: "bottom-start" });

Introduction

Floating UI is especially relevant for tooltips, dropdowns and popovers because its DOM primitives are framework-agnostic.

Preact configuration

The DOM package can be used directly without React bindings.

SSR notes

Position calculations happen in the browser, so render a sensible static fallback on the server.

Islands notes

A strong fit for small interactive overlays inside otherwise static pages.

Alternatives