Packages

@floating-ui/react

0.27.20 · 11 Jul 2026MIT34.1M / weekRepositoryHomepagenpmAtom feed

Your version

0.21.0

12 Mar 2023Where it was published

0.27.20 is the newest release of 0.21.x.

In short

1 deprecated1 new12 fixed3 internal

  • Deprecated

    useTypeahead: Add onTypingChange callback to allow setting a local ref and deprecate context.dataRef.current.typing value

Release note

New Features

  • useClientPoint interaction hook

    This hook provides the ability to position the floating element relative to a client "point" reference. By default, "client" means mouse event coordinates since they possess clientX/Y values, so it follows the cursor when open. You can also use explicit x and y client coordinates.

    If you've used Tippy.js, it provides similar functionality to followCursor while being a bit more general.

    const clientPoint = useClientPoint(context, {
      enabled?: boolean,
      // Restrict the client point to an axis, use the DOM
      // reference as the other axis
      axis?: 'both' | 'x' | 'y',
      // Position explicitly at these client coordinates
      x?: number | null,
      y?: number | null,
    });

Refactors

  • Deprecated

    useTypeahead: Add onTypingChange callback to allow setting a local ref and deprecate context.dataRef.current.typing value

Bug Fixes

  • useFloating: Return extended elements from hook

  • useListNavigation: Use mounted rather than open state to focus parent floating in tree

  • FloatingFocusManager: Make initialFocus and returnFocus non-reactive

  • Share floatingId via context object

  • FloatingFocusManager: Reset preventing returnFocus with closeOnFocusOut={false} when tabbing out then back in

  • FloatingFocusManager: Mutate internal preventReturnFocusRef instead of returnFocusRef

  • useTypeahead: Improve logic

    • Reset timeout from a non-match

    • Don't require a role be set and stop propagation/prevent default if typeahead is in use

  • FloatingFocusManager: Ensure returnFocus of a nested floating element can return to a root reference if it wasn't focused upon open (such as with a pointer)

  • FloatingArrow: Prevent transparency overlap if the floating element border and stroke are both partially transparent

  • FloatingFocusManager: Ensure initialFocus works if re-opening floating element while it was transitioning out

  • FloatingArrow: Ensure correct vertical size with larger stroke widths

  • FloatingArrow: Allow height > width

A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.