Floating UI

Low-level JavaScript library for positioning floating elements (tooltips, popovers, dropdowns, menus) relative to anchor elements. Handles collision detection, overflow prevention, placement flipping, and arrow positioning. Framework-agnostic core with React, Vue, and React Native adapters. Successor to Popper.js — more modern API, better TypeScript support, smaller bundle. Used internally by Radix UI, Headless UI, and many UI libraries.

Evaluated Mar 06, 2026 (0d ago) v1.x
Homepage ↗ Repo ↗ Developer Tools tooltip popover dropdown positioning react headless floating accessibility
⚙ Agent Friendliness
69
/ 100
Can an agent use this?
🔒 Security
95
/ 100
Is it safe for agents?
⚡ Reliability
88
/ 100
Does it work consistently?

Score Breakdown

⚙ Agent Friendliness

MCP Quality
--
Documentation
92
Error Messages
82
Auth Simplicity
100
Rate Limits
100

🔒 Security

TLS Enforcement
95
Auth Strength
95
Scope Granularity
92
Dep. Hygiene
92
Secret Handling
98

Pure computation library — no network calls, no data persistence. No security concerns beyond standard XSS prevention in rendered content.

⚡ Reliability

Uptime/SLA
90
Version Stability
90
Breaking Changes
85
Error Recovery
88
AF Security Reliability

Best When

You need precise floating element positioning with automatic viewport collision detection, or you're building a component library that needs robust tooltip/popover positioning.

Avoid When

You need complete accessible UI components — use Radix UI (which uses Floating UI internally) for complete primitives with positioning included.

Use Cases

  • Position tooltips, popovers, and dropdown menus that automatically flip and shift to stay within viewport boundaries
  • Build custom select menus, comboboxes, and date pickers with correct positioning without writing collision detection code
  • Create context menus, right-click menus, or floating panels that intelligently position relative to trigger elements
  • Implement accessible tooltips and popovers as the positioning layer, combined with accessibility libraries for ARIA
  • Replace Popper.js with a modern, tree-shakeable positioning library with better TypeScript and React integration

Not For

  • Complete UI components — Floating UI handles positioning only; use Radix UI or Headless UI for accessible component logic
  • CSS-only tooltips — simple use cases can use CSS :hover + position:absolute without JavaScript
  • Teams building with design systems that already include tooltip positioning (MUI, Chakra) — they use Floating UI internally already

Interface

REST API
No
GraphQL
No
gRPC
No
MCP Server
No
SDK
Yes
Webhooks
No

Authentication

Methods: none
OAuth: No Scopes: No

No authentication — pure client-side positioning library.

Pricing

Model: open_source
Free tier: Yes
Requires CC: No

MIT licensed. Completely free. Maintained by same team as Popper.js.

Agent Metadata

Pagination
none
Idempotent
Full
Retry Guidance
Not documented

Known Gotchas

  • Floating UI handles positioning only — focus management, ARIA attributes, and keyboard navigation must be implemented separately or via Radix UI
  • @floating-ui/react package provides React hooks but still requires managing open/close state and focus manually
  • Middleware order matters — shift, flip, and offset middleware interact; wrong order produces unexpected placement
  • Portal rendering (appending floating element to body) is recommended to avoid z-index and overflow:hidden issues — requires portal setup
  • Position calculation runs on every render by default — use stable references (useRef, useMemo) to avoid performance issues with frequent re-renders
  • The arrow element positioning requires additional CSS (transform, width/height) — the library provides coordinates but rendering is developer responsibility

Alternatives

Full Evaluation Report

Detailed scoring breakdown, competitive positioning, security analysis, and improvement recommendations for Floating UI.

$99

Scores are editorial opinions as of 2026-03-06.

5215
Packages Evaluated
26151
Need Evaluation
173
Need Re-evaluation
Community Powered