@floating-ui/core
1.8.0 · 11 Jul 2026MIT130.1M / weekRepositoryHomepagenpmAtom feed
63 stable releases, newest first, by release line. Notes are quoted as the maintainers published them.
- 1.x · latest line
1.8.0
11 Jul 2026Add
'layoutViewport'string option torootBoundary. Unlike the visual'viewport'boundary, it remains stable while pinch-zooming or when a mobile software keyboard is open, and unlike a manually passedRectof the documentElement's client size, it accounts for space reserved byscrollbar-gutter: stable.inline: no-op on empty client rects and detect RTL disjoined line rects
Support explicit
undefinedfor optional properties withexactOptionalPropertyTypes
Minor Changes
Add
'layoutViewport'string option torootBoundary. Unlike the visual'viewport'boundary, it remains stable while pinch-zooming or when a mobile software keyboard is open, and unlike a manually passedRectof the documentElement's client size, it accounts for space reserved byscrollbar-gutter: stable.
Patch Changes
inline: no-op on empty client rects and detect RTL disjoined line rects
Support explicit
undefinedfor optional properties withexactOptionalPropertyTypessize: Correctly compute available size for centered elements overflowing both sides
core: Reduce bundle size with behavior-identical middleware simplifications
1.7.5
3 Mar 2026Bundle and runtime improvements
Patch Changes
Bundle and runtime improvements
1.7.4
27 Jan 2026detectOverflow configurable via platform
1.7.3
30 Jul 2025flip: Ensure perpendicular axis flips with crossAxis alignment
1.7.2
28 Jun 2025Reduce memory allocations
Patch Changes
Reduce memory allocations
1.7.1
2 Jun 2025flip: Only allow fallback to the perpendicular axis if all placements on the preferred side axis overflow the main axis with
crossAxis: 'alignment'
1.7.0
2 May 2025flip: Add
"alignment"string value forcrossAxisoption. This value determines if cross axis overflow checking is restricted to thealignmentof the placement only. This preventsfallbackPlacements/fallbackAxisSideDirectionfrom too eagerly changing to the perpendicular side (thereby preferringshift()if overflow is detected along the cross axis, even ifshift()is placed afterflip()in the middleware array).
1.6.9
7 Jan 2025Only updates a dependency:@floating-ui/utils 0.2.9
1.6.8
15 Sep 2024size: Fill viewport along an axis if shift is enabled on that axis
offset: Avoid NaN when mainAxis or crossAxis is undefined
Patch Changes
size: Fill viewport along an axis if shift is enabled on that axis
offset: Avoid NaN when mainAxis or crossAxis is undefined
1.6.4 – 1.6.74 releases that only update dependencies@floating-ui/utils 0.2.7Show each
- 1.6.77 Aug 2024@floating-ui/utils 0.2.7
- 1.6.65 Aug 2024@floating-ui/utils 0.2.6
- 1.6.522 Jul 2024@floating-ui/utils 0.2.5
- 1.6.430 Jun 2024@floating-ui/utils 0.2.4
1.6.3
25 Jun 2024flip: Adjust
bestFitalgorithm to only useinitialPlacementoryside axis withfallbackAxisSideDirection
Patch Changes
flip: Adjust
bestFitalgorithm to only useinitialPlacementoryside axis withfallbackAxisSideDirection
1.6.2
15 May 2024size: Correctly constrain floating element to avoid overflowing outside viewport with
shift({crossAxis: true})
1.6.1
28 Apr 2024Avoid spreading rects to support
DOMRecttypes
1.5.3
6 Jan 2024Only updates a dependency:@floating-ui/utils 0.2.0
1.5.2
6 Dec 2023types: Avoid ts 4.2+ syntax
1.5.1
30 Nov 2023offset: Avoid doubling calculation on same placement reset when
arrowchanges alignment of floating element
1.5.0
15 Sep 2023arrow: Add
alignmentOffsetdataflip: Skip if arrow has performed internal shifting
1.4.2
14 Sep 2023arrow: Perform a reset if internal shifting is performed
This allows
shift()to continue taking action when the arrow's internal
shifting of the floating element is performed (preventing potential
overflow/clipping of the floating element in certain scenarios), while still
allowing the arrow to point toward the reference when it is small if possible.
Patch Changes
arrow: Perform a reset if internal shifting is performed
This allows
shift()to continue taking action when the arrow's internal
shifting of the floating element is performed (preventing potential
overflow/clipping of the floating element in certain scenarios), while still
allowing the arrow to point toward the reference when it is small if possible.
1.4.1
30 Jul 2023types: Resolution when using
moduleResolution: "NodeNext"
1.4.0
28 Jul 2023Maintenance only: docs, tests, build or refactoring. Nothing changes in how you use it.
1.3.1
17 Jun 2023arrow: Report correct
centerOffsetvalue when internal shifting is active
1.3.0
11 Jun 2023Allow function types for all middleware options, including
detectOverflow, to allow derivation from state// Options shift({mainAxis: true}); // Derived from state shift((state) => ({mainAxis: state.rects.reference.width > 10}));arrow: Ensure large
paddingoption value does not cause incorrect centering
New Features
Allow function types for all middleware options, including
detectOverflow, to allow derivation from state// Options shift({mainAxis: true}); // Derived from state shift((state) => ({mainAxis: state.rects.reference.width > 10}));
Bug Fixes
arrow: Ensure large
paddingoption value does not cause incorrect centering
1.2.6
7 Apr 2023size: Unresponsive
availablesize if floating element resized using a center-aligned placement withshift()in use
1.2.5
25 Mar 2023Remove DEV warnings (
process.env)
1.2.4
14 Mar 2023inline: Correct merging of rects by line
1.2.3
12 Mar 2023inline: Merge rects on the same line (y coord)
1.2.2
1 Mar 2023arrow: Correctly take into account floating element
borderfor<svg>arrows
1.2.1
12 Feb 2023- deprecated
types: Deprecate
MiddlewareArgumentsin favor ofMiddlewareStatetype
1.2.0
5 Feb 2023autoPlacement:
crossAxisoptionBy default, aligned placements like
top-start/top-enduse a "fallback" strategy for thecrossAxisto ensure different axes' placements can be chosen, and to keep the preferredalignmentas 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
Rectboundariessize: Consider case where
shift()is in the middleware array beforesize()for center aligned placements
New Features
autoPlacement:
crossAxisoptionBy default, aligned placements like
top-start/top-enduse a "fallback" strategy for thecrossAxisto ensure different axes' placements can be chosen, and to keep the preferredalignmentas 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
Rectboundaries
Bug Fixes
size: Consider case where
shift()is in the middleware array beforesize()for center aligned placementsautoPlacement: Prevent resetting placement unexpectedly to opposite alignment when it overflows on all sides
flip: When no placements fit, but before
fallbackStrategyphase, if multiple placements fit on the mainAxis of overflow, choose the placement that fits best on the main crossAxis side of overflowautoPlacement: General algorithm improvements
size: General algorithm improvements
1.1.1
29 Jan 2023flip: Try
mainAxisoverflow check first once in fallback phase
1.1.0
2 Jan 2023flip:
fallbackAxisSideDirectionoptionThis option adds the ability to compute placements on the opposite axis of the preferred placement without needing to use an explicit
fallbackPlacementslist, meaning you no longer need to manage a custom map offallbackPlacementsand instead use this option to leverage automatic computing of the array.This option determines whether to allow fallback to the opposite axis if no placements along the preferred placement axis fit, and if so, which side direction along that axis to choose. If necessary, it will fallback to the other direction.
Note:
In RTL writing direction, the x-axis directions are reversed.For instance, by default, if the initial
placementis set to'right', then the placements to try (in order) are:['right', 'left']On a narrow viewport, it's possible or even likely that neither of these will fit.
By specifying a string other than
'none', you allow placements along the opposite axis of the initial placement to be tried. The direction determines which side of placement is tried first:flip({ fallbackAxisSideDirection: 'start', });The above results in:
['right', 'left', 'top', 'bottom'].flip({ fallbackAxisSideDirection: 'end', });The above results in:
['right', 'left', 'bottom', 'top'].As an example, if you'd like a tooltip that has a placement of
'right'to be placed on top on mobile (assuming it doesn't fit), then you'd use'start'. For an interactive popover, you likely want to use'end'so it's placed on the bottom, closer to the user's fingers.
New Features
flip:
fallbackAxisSideDirectionoptionThis option adds the ability to compute placements on the opposite axis of the preferred placement without needing to use an explicit
fallbackPlacementslist, meaning you no longer need to manage a custom map offallbackPlacementsand instead use this option to leverage automatic computing of the array.This option determines whether to allow fallback to the opposite axis if no placements along the preferred placement axis fit, and if so, which side direction along that axis to choose. If necessary, it will fallback to the other direction.
'none'signals that no fallback to the opposite axis should take place. (default)'start'represents'top'or'left'.'end'represents'bottom'or'right'.
Note:
In RTL writing direction, the x-axis directions are reversed.For instance, by default, if the initial
placementis set to'right', then the placements to try (in order) are:['right', 'left']On a narrow viewport, it's possible or even likely that neither of these will fit.
By specifying a string other than
'none', you allow placements along the opposite axis of the initial placement to be tried. The direction determines which side of placement is tried first:flip({ fallbackAxisSideDirection: 'start', });The above results in:
['right', 'left', 'top', 'bottom'].flip({ fallbackAxisSideDirection: 'end', });The above results in:
['right', 'left', 'bottom', 'top'].As an example, if you'd like a tooltip that has a placement of
'right'to be placed on top on mobile (assuming it doesn't fit), then you'd use'start'. For an interactive popover, you likely want to use'end'so it's placed on the bottom, closer to the user's fingers.
Combining with
shiftIf
shift()is in use in the middleware array, you may desire to disablecrossAxisoverflow checking, which will allowshift()to perform its work without falling back to the opposite axis (therefore preserving the original axis as best as possible):const middleware = [ flip({ fallbackAxisSideDirection: 'start', crossAxis: false, }), shift(), ];This will depend on the desired positioning you want to achieve, e.g. if the placement has an explicit alignment specified or not.
1.0.4
7 Dec 2022Fixed #143
You can't no longer access Tooltip.js builds from the Popper.js npm package, install both the packages if you need them!
Fixed #144
Don't ask where v1.0.3 gone, no idea.
By the way, here's the changelog for this version:
Fixed #143
You can't no longer access Tooltip.js builds from the Popper.js npm package, install both the packages if you need them!
We also released Tooltip.js v1.0.3:
Fixed #144
You can't no longer access Popper.js builds from the Tooltip.js npm package, install both the packages if you need them!
1.0.3
6 Dec 2022detectOverflow: Pass correct fallback rect
If
platform.convertOffsetParentRelativeRectToViewportRelativeRectwas not available, then the correct rect was not passed. So a custom platform without that method actually did need it (even though it's optional).
1.0.2
15 Nov 2022Maintenance only: docs, tests, build or refactoring. Nothing changes in how you use it.
1.0.0
19 Jul 2022- breaking
Removed all the underscores
_prefixes from properties - breaking
Removed
parsemethod from core library, you can't automatically create popper's markup using Popper.js core. If you need the feature, here you can find a custom modifier that reintroduces the feature. gist.github.com/FezVrasta/075d228ffb855688c75a6… - breaking
Simplified modifiers API, see #62 for migration instructions
Read the introduction post about Popper.js v1 at medium.com/@FezVrasta/popper-js-v1-5e8b3acd888c
Changelog:
- breaking
Removed all the underscores
_prefixes from properties Converted source code to ES6
Build now uses Rollup
Moved from JSHint to ESLint
Moved from Uglify to Babili
Get rid of Grunt
Updated npm dependencies
- breaking
Removed
parsemethod from core library, you can't automatically create popper's markup using Popper.js core. If you need the feature, here you can find a custom modifier that reintroduces the feature. gist.github.com/FezVrasta/075d228ffb855688c75a6… Added Tooltip.js library to replace the
parsemethod- breaking
Simplified modifiers API, see #62 for migration instructions
- breaking
Modifiers options are now stored inside the modifiers configurations, see #62
Full support for HTML5 shadow root and HTML5 components (#88) (thanks @nadiam84)
- breaking
boundariesElement has been deprecated in favor to new options of
preventOverflowandflipmodifiers You can now set attributes defining them in
data.attributes, properties withfalsevalues will be removed- breaking
onCreateandonUpdatemethods have been converted to properties of theoptionsobject
you can now use them withnew Popper(a, b, { ...otherOptions, onCreate: () => {}, onUpdate: () => {} }) - breaking
gpuAccelerationis now an option of theapplyStylemodifier (modifiers.applyStyle.gpuAcceleration) Added
autoplacement, it will automatically get converted to the placement with more free space available (addresses #1)Added
innermodifier, it allows to make the popper flow toward the inner of the reference element (addresses #83)From now on, the changelog will be posted in the GitHub releases and not in the CHANGELOG.md file
- 0.7.x
0.7.3
12 Jun 2022TS typedefs are now generated as "strict"
Add safeguard return to bail out of positioning after 50 reset requests, preventing any infinite loops, even if more resets are requested. In DEV mode, the error about the positioning loop is now just a warning.
0.7.1
20 May 2022arrow: When
paddingis specified, the coordinates of the floating element are now adjusted if needed to ensure the arrow continues to point at the center of the reference element. This takes precedence overstartandendalignments.
0.7.0
7 May 2022- breaking
In both the
size()andoffset()middleware, thereferenceandfloatingtop-level parameters are now namespaced underrects—rects.referenceandrects.floating.The entire
MiddlewareArgumentsobject gets spread in, so there's more data to access if needed. Added "browser" export conditions
BREAKING: removed the previous "production" and "development" export conditions. The new "browser" key is a replacement for this. See Package entry points.
arrow: Fallback to the
floatingelement as theoffsetParentReact Native / other platforms that do not implement
getOffsetParent
New Features
Added "browser" export conditions
BREAKING: removed the previous "production" and "development" export conditions. The new "browser" key is a replacement for this. See Package entry points.
Refactors
- breaking
In both the
size()andoffset()middleware, thereferenceandfloatingtop-level parameters are now namespaced underrects—rects.referenceandrects.floating.The entire
MiddlewareArgumentsobject gets spread in, so there's more data to access if needed.
Bug Fixes
arrow: Fallback to the
floatingelement as theoffsetParentReact Native / other platforms that do not implement
getOffsetParent
- 0.6.x
0.6.2
18 Apr 2022v0.6.1 was bugged, DO NOT use it
v0.6.2 fixed the previous version fixing the problem with the positioning inside fixed containers
0.6.1
12 Mar 2022Fixed positioning issue with fixed parents
- 0.5.x
0.5.1
27 Feb 2022Added support for a reference el that is both fixed and transformed. (thanks @hgascoigne)