Floating UI anchors floating elements to page references while avoiding viewport collisions. React hooks and DOM packages support tooltips, popovers, menus, and similar patterns.
Overview
Floating UI replaces the earlier Popper project and focuses on absolutely positioned UI such as tooltips, popovers, dropdowns, and dialogs. Anchor positioning keeps elements visible using placement, shift, flip, size, arrow, and inline middleware, with auto-update when the page scrolls or resizes.
Packages target vanilla DOM, React DOM, React Native, and Vue. Custom platforms allow use on Canvas or other JavaScript environments. Modules are tree-shakeable so bundlers can include only needed positioning logic.
For React, the library offers interaction primitives for accessible hover, click, and focus behavior. Base UI is a separate headless React component set built on Floating UI for tooltips, menus, selects, dialogs, and toasts. Install options include npm and CDN distributions.
Key features
- Collision-aware anchor positioning
- Shift, flip, and size middleware
- Virtual reference coordinates
- React interaction hooks
- Vue and React Native bindings
- Custom platform adapters
- Tree-shakeable modules
- Arrow alignment helpers
Use cases
- Tooltip and popover components
- Dropdown and select menus
- Accessible floating dialogs
- Design system overlay positioning