Library / SDK
floating-ui/floating-ui avatar
floating-ui/floating-ui

Floating UI: A Positioning Library That Puts Collision Avoidance First

GitHub describes it as A JavaScript library to position floating elements and create interactions for them.. The repository metadata lists TypeScript as its primary language. The metadata lists the MIT license. This article stays within the project description and details documented in the GitHub repository README.

32,819 stars1,731 forksTypeScriptMIT

At a glance

What is it?
Floating UI is a TypeScript library for anchoring floating elements like tooltips and dropdowns while avoiding viewport collisions. This review covers its architecture, platform packages, and the trade-offs you should weigh before adopting it.
Who is it for?
Adopt Floating UI if you build tooltips, popovers, or dropdowns that must stay visible inside scrolling containers and near viewport edges, and if you want a library that treats collision avoidance as a first-class feature rather than an afterthought. Skip it if you need a full component suite or if you are already invested in a framework-specific solution that covers your interactions out of the box.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 11 days ago.
What is it written in?
Mainly TypeScript, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on November 23, 2026, and from our analysis. They are not legal advice.

From daily snapshots

Star history

  • floating-ui/floating-ui32,819 ★ · +121
Star history
Repository2026-08-132026-11-23
floating-ui/floating-ui32.7k32.8k

121 Stars in the last 102 days, measured from the daily GitHub snapshot. Compare with other projects

Editorial analysis

The Problem: Floating Elements Are Hard to Keep Visible

Floating UI solves a specific problem: anchoring a floating element to another element while keeping it in view. The README states that floating elements are absolutely positioned and typically anchored to another UI element. That sounds simple, but the documentation points out two hard parts. First, scrolling containers break naive absolute positioning. Second, when the floating element gets too close to the viewport edge, it collides and becomes obscured. The library provides tools for these cases, but the application must configure overflow middleware and position updates appropriate to its layout. It is for developers building tooltips, popovers, dropdowns, and similar components, not for end users. The target audience is engineers who want low-level control over positioning rather than a pre-built widget.

Two Features, Two Audiences: Positioning vs. React Interactions

The README splits the library into two main features. The first is anchor positioning, available for all platforms. The second is user interactions for React, delivered as hooks and components. That split matters. If you use vanilla JavaScript, Vue, or React Native, you get positioning only. You must handle focus management, keyboard navigation, and dismissal yourself. If you use React DOM, the @floating-ui/react package adds interaction primitives. This is a deliberate design choice. The library is not a component kit. It gives you pieces to compose accessible floating UI components. The README mentions accessibility issues in the context of interactive floating elements, so the interaction hooks are meant to address those concerns, but only for React.

How It Works: computePosition and the Platform Abstraction

`computePosition(reference, floating)` calculates coordinates asynchronously; the application applies them to an appropriately styled and measurable element. It does not automatically keep that element in view: add middleware such as `flip()` and `shift()` to handle overflow. Use `autoUpdate()` to rerun positioning when relevant layout or scroll changes occur, and call its cleanup function when the element closes.

The core package contains platform-independent logic, while `@floating-ui/dom` provides DOM measurements. A custom platform can implement the necessary measurement methods for another environment. Positioning and interaction behavior still need testing for the actual component and viewport.

Getting Started: Real Install Commands for Each Platform

Installation is straightforward, with separate packages per environment. For vanilla JavaScript, run npm install @floating-ui/dom. For React DOM with interactions, run npm install @floating-ui/react. If you only need positioning in React and want a smaller bundle, npm install @floating-ui/react-dom. For Vue, npm install @floating-ui/vue. For React Native, npm install @floating-ui/react-native. For other platforms, npm install @floating-ui/core and build your own Platform. The README points to a tutorial for the vanilla path and API docs for computePosition. The project is a pnpm monorepo, so contributors run pnpm install and pnpm run build first. The development playground for DOM runs with pnpm run --filter @floating-ui/dom dev, which launches visual tests at localhost:1234 with Playwright screenshots.

A Real Limitation: The Core Is Low-Level and Thin

The biggest limitation is that Floating UI does not give you ready-made components. The README says it offers low-level features. That means you write your own tooltip markup, your own open/close state, and your own styling. For React, the interaction hooks help, but you still assemble the pieces. This is the wrong tool if you want a drop-in solution or if you are not comfortable composing positioning logic. Another constraint is that the interaction feature is React-only.

The Alternative: Popper and Framework-Specific Solutions

The obvious alternative is Popper, the predecessor. The README explicitly says Popper is now Floating UI, and the v2 branch remains available. Popper v2 is a mature library with its own docs and migration guide. The difference in approach is that Popper v2 is a standalone positioning engine, while Floating UI extends that with interaction hooks for React and a platform abstraction for other environments. If you already use Popper v2 and it works, you might not need to migrate. Another alternative is framework-specific solutions like React Bootstrap or Material UI popovers, which bundle positioning with styling and behavior. Those are higher-level options that include styling and behavior; bundle size and flexibility depend on the component and usage. Floating UI's approach is to give you the positioning primitives and let you build the rest.

Maintenance and License: What the Repository Tells Us

The repository is not archived, and the last push was September 2026, with recent releases for @floating-ui/vue, @floating-ui/react-dom, and @floating-ui/utils (July 2026). That indicates active maintenance, though the README does not state a release policy or support window. The project is MIT licensed, which means you can use it in commercial projects without licensing fees, though this is not legal advice. The monorepo uses pnpm and TypeScript, which is a sign of a structured codebase. The repository describes Playwright screenshot testing for the DOM playground; that does not establish complete coverage of every interaction or application layout. However, the README does not mention how to upgrade or what breaking changes might come. You should check the migration guide if you are moving from Popper, and monitor the release notes for breaking changes.

Editorial conclusion

Adopt Floating UI if you build tooltips, popovers, or dropdowns that must stay visible inside scrolling containers and near viewport edges, and if you want a library that treats collision avoidance as a first-class feature rather than an afterthought. Skip it if you need a full component suite or if you are already invested in a framework-specific solution that covers your interactions out of the box. Before adopting, verify that the platform package you need is maintained: the recent releases show active work on @floating-ui/vue, @floating-ui/utils, and @floating-ui/react-dom, but the README does not state release cadence or long-term support. Check the migration guide if you are coming from Popper, and confirm that the low-level API matches your team's comfort with composing positioning logic manually.

Frequently asked questions

How do I install Floating UI?

It is installed per platform. Vanilla JavaScript on the web is `npm install @floating-ui/dom`, React DOM is `npm install @floating-ui/react` or `npm install @floating-ui/react-dom` for positioning only, React Native is `npm install @floating-ui/react-native`, Vue is `npm install @floating-ui/vue`, and Canvas or another platform is `npm install @floating-ui/core` so you can build your own Platform.

How does Floating UI work?

`computePosition` calculates coordinates for a floating element relative to a reference element. Configure middleware such as `flip` and `shift` for overflow handling and use `autoUpdate` when position must be recalculated on scroll or resize; clean it up when the element closes.

What is Floating UI React and how is it different from the DOM package?

The React package comes in two forms. `npm install @floating-ui/react` gives positioning plus interactions, while `npm install @floating-ui/react-dom` is positioning only and smaller. Those interactions are the hooks and components for composing accessible floating UI components, the second of the project's two main features.

Floating UI vs Popper: what changed?

The project states that Popper is now Floating UI. Popper v2 lives on a dedicated v2.x branch with its own documentation on popper.js.org, and a migration guide covers moving across, while the default branch is master and carries the current line.

Floating UI vs Tippy: which one should I pick?

Tippy is not covered in this repository, so the comparison comes down to the level each one works at. Floating UI positions an element and avoids collisions as a set of low-level features, leaving the markup and styling to you, whereas a finished component library supplies its own.

What is Floating UI used for?

Floating UI provides positioning primitives for tooltips, popovers and menus, plus React interaction hooks and components. The application still supplies its own markup, styles and appropriate behavior; overflow handling and position updates must be configured.

Official sources

  1. Official documentation
  2. Official README
  3. Project repository
  4. Release notes
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/floating-ui-floating-ui.svg)](https://hysenlabs.com/projects/floating-ui-floating-ui)

Star history chart for your README

markdown
[![Star history](https://hysenlabs.com/chart/floating-ui-floating-ui.svg)](https://hysenlabs.com/projects/floating-ui-floating-ui)

Was this useful?