BASE

Floating UI

Floating UI

UI library · Free

Calculates floating interface positions: places menus, tooltips, and popovers beside an anchor while accounting for viewport boundaries.

Also known as: floating-ui/floating-ui; floating-ui; floating-positioning

Resource illustration: Floating UI

Open resource ↗

What you can use for free

Code and local use under MIT.

Paid features and costs

Computing resources, self-hosting, and external services are paid for separately if used.

Access and limitations

Code and local use under MIT. Computing resources, self-hosting, and external services are paid for separately if used.

Use cases

  • Place a popover beside an interface element
  • Configure placement and viewport boundary handling during scroll/resize

Example workflow

A possible workflow; this is not a report of hands-on testing.

Place a popover beside an interface element.

Before you start

  • The component's design, states, and data.
  • A compatible framework and the project's styles.

Steps

  1. Connect the reference element and floating container.
  2. Configure placement and viewport boundary handling during scroll/resize.
  3. Configure styles and check empty, loading, and error states.

Check your result

  • The keyboard, focus indicators, and a screen reader let users complete the action.
  • The component works on a narrow screen and with long data values.

Choosing Floating UI

Place a popover beside an interface element

Choose this when

  • Place a popover beside an interface element
  • Configure placement and viewport boundary handling during scroll/resize

Requirements

  • Choose the package for your platform and define the anchor and floating element.

Things to consider

  • Costs and limits of free use: Computing resources, self-hosting, and external services are paid for separately if used.
  • Terms of use: MIT for the code; dependencies have separate licenses.
  • Basic positioning alone does not implement the component's full keyboard/focus workflow: React interactions require the corresponding package.

Frequently asked questions

What can you use for free in Floating UI?

Code and local use under MIT.

What additional costs might arise with Floating UI?

Computing resources, self-hosting, and external services are paid for separately if used.

What terms of use matter for Floating UI?

MIT for the code; dependencies have separate licenses.

How do you get started with Floating UI?

Connect the reference element and floating container. Configure placement and viewport boundary handling during scroll/resize. Configure styles and check empty, loading, and error states.

How does @floating-ui/react differ from @floating-ui/react-dom?

@floating-ui/react combines positioning with React interactions. If you only need coordinates and collision handling, the smaller @floating-ui/react-dom package is available. Separate packages exist for DOM, React Native, and Vue; the core lets you connect your own platform.

License

MIT for the code; dependencies have separate licenses.

MIT — permissive license

You can use, modify, distribute, and sell the code, including in a closed-source commercial product. When sharing copies or substantial portions of the code, retain the license text and copyright notice. You do not need to open-source your entire project; the author provides no warranties.

License terms

Technologies and topics

  • Floating UI
  • UI
  • Development

Sources

Other resources