Core positioning engine for floating elements. Adapted from toddler.popup positioning logic.
Core positioning engine for floating elements. Adapted from toddler.popup positioning logic.
(auto-update target-el floating-el update-fn config)Create auto-update system for position tracking. Takes a config map with same options as find-best-position. Returns cleanup function.
Create auto-update system for position tracking. Takes a config map with same options as find-best-position. Returns cleanup function.
(calculate-placement {:keys [target-rect floating-rect placement offset padding
scrollbar-width container-padding]})Calculate position for a specific placement
Calculate position for a specific placement
(find-best-position {:keys [target-el floating-el preferences offset padding
container-padding]
:or {offset 8
padding 8
container-padding 0
preferences (:default placement-preferences)}})Find the best position for the floating element
Find the best position for the floating element
(get-element-rect el)Get element dimensions relative to viewport
Get element dimensions relative to viewport
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |