Packages

@floating-ui/core

1.8.0 · 11 Jul 2026MIT130.1M / weekRepositoryHomepagenpmAtom feed

Your version

1.2.0

5 Feb 2023Where it was published

1.8.0 is the newest release of 1.x.

In short

2 new4 fixed

Release note

New Features

  • autoPlacement: crossAxis option

    By default, aligned placements like top-start/top-end use a "fallback" strategy for the crossAxis to ensure different axes' placements can be chosen, and to keep the preferred alignment as much as possible.

    However, if you only have placements along one axis you can now use a "most space" strategy for the alignment as well, e.g.:

    autoPlacement({
      allowedPlacements: [
        'top-start', 
        'top-end', 
        'bottom-start', 
        'bottom-end'
      ],
      crossAxis: true,
    });
  • detectOverflow: Accept virtual Rect boundaries

Bug Fixes

  • size: Consider case where shift() is in the middleware array before size() for center aligned placements

  • autoPlacement: Prevent resetting placement unexpectedly to opposite alignment when it overflows on all sides

  • flip: When no placements fit, but before fallbackStrategy phase, if multiple placements fit on the mainAxis of overflow, choose the placement that fits best on the main crossAxis side of overflow

  • autoPlacement: General algorithm improvements

  • size: General algorithm improvements