- Docs
- Popper
Flexipop - Positioning Engine for Flexilla
Flexipop is a lightweight and efficient positioning engine tailored for Flexilla, offering seamless popper-like functionality with minimal overhead.
Installation
Install Flexipop via npm:
Basic Usage
To use Flexipop, you simply need to create an instance of
CreatePopper
, passing the reference element and the popper element along with any custom options you may require: Example HTML Markup
Note: The
popperElement
should have its position
set to fixed
.
Bottom
Required Styles for the popperElement
Usage with position: absolute
Flexipop also supports poppers with
position: absolute
. This version is useful when the reference and popper elements are within the same container, and you need the popper to behave according to the flow of the containing element. Installation for Absolute Positioning
Requirements
- The
popperElement
must have itsposition
set toabsolute
. - Both the
referenceElement
andpopperElement
should be in the same parent container. - The parent container must have its
position
set torelative
.
Example HTML Markup for Absolute Positioning
- CSS
Important: Be sure that the parent container has
position: relative
, and the popperElement
has position: absolute
. Options
The options provided to Flexipop help control how your popper is positioned. You can set placement, offsets, and more to adjust its behavior.
Available Options
-
placement
: Defines the position of the popper relative to the reference element (top
,bottom
,left
,right
, with alignment options like-start
,-end
,-middle
).Example: -
offsetDistance
: Adds a specific distance (in pixels) between the reference and popper elements.