Packages

@floating-ui/react

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

Your version

0.16.0

7 Jan 2023Where it was published

0.27.20 is the newest release of 0.16.x.

In short

1 new2 fixed

Release note

New Features

  • useTransitionStatus and useTransitionStyles hooks

    These hooks make it easy to add CSS transitions to your floating elements, namely if you aren't using a spring library already like framer-motion/react-spring etc, but especially makes "placement-aware" transitions straightforward.

    A basic symmetric scale transition looks like:

    const {isMounted, styles} = useTransitionStyles(context, {
      initial: {
        opacity: 0,
        transform: 'scale(0.8)',
      },
    });
    
    return isMounted && <div style={styles} />;

    A placement/side-aware transition looks like:

    const {isMounted, styles} = useTransitionStyles(context, {
      initial: ({side}) => ({
        opacity: 0,
        transform: {
          top: 'translateY(5px)',
          bottom: 'translateY(-5px)',
          right: 'translateX(-5px)',
          left: 'translateX(5px)',
        }[side],
      }),
    });
    
    return isMounted && <div style={styles} />;

Bug Fixes

  • Preserve backwards-compatibility for multiple reference() calls for old virtual element position technique

    Going forward, the new positionReference callback ref is recommended instead, this is only to ensure upgrading does not break your old code.

  • FloatingFocusManager: Make return focus calls sync under certain conditions

    Only in Strict Mode, Safari would not navigate via arrow down keys due to sync navigation (<Menu> example)

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.