v0.0.14
components

Floating

A Floating UI wrapper component for positioning elements like tooltips, popovers, or dropdowns dynamically, ensuring they stay visible and aligned relative to a reference element.

API Reference

FloatingProps

Extends all the standard HTML attributes of the `<div>` element.

PropertyTypeDefaultDescription
ref $bindable
HTMLDivElement
Reference to the rendered DOM element.
isOpen $bindable
boolean
Manage/listen open state
onClose
function
Callback when floating is closed
size
union
"3"Floating size
color
union
Floating color
variant
union
"solid"Floating variant
outline
boolean
falseFloating outline
radius
union
Floating radius
autoUpdate
boolean
falseUpdateposition on scroll
placement
union
"top"Prefered placement
offset
number
0Floating offset from target
arrow
boolean
falseShow arrow
arrowWidth
number
Arrow width (only if arrow is true)
arrowHeight
number
Arrow height (only if arrow is true)
arrowTipRadius
number
FloatingArrow tip radius
flip
boolean
falseUse flip floating middleware
shift
boolean
falseUse shift floating middleware
hide
boolean
falseUse hide floating middleware
backdrop
boolean
falseShow backdrop
portal
boolean
falseEnable portal rendering
portalTarget
string
"[data-theme-root]"Portal target identifier. Only if portal is true
focusOnOpen
union
Focus element on open floating
focusOnClose
union
Focus element on close floating
focusTrap
boolean
falseTrap focus inside floating content
closeOnBackdropClick
boolean
falseClose floating on backdrop click. Only if backdrop is true
closeOnOutsideClick
boolean
falseClose floating on outside click
closeOnEscape
boolean
falseClose floating on escape key
closeOnResize
boolean
falseClose floating on resize
closeOnScroll
boolean
falseClose floating on scroll
transitionDelay
number
0Transition delay of open/close animation
transitionDuration
number
150Transition duration of open/close animation
trigger
Snippet
Floating trigger content to render
content
Snippet
Floating content to render

Examples

Arrow

Close from inside

Floating ui middlewares

Open on hover

Variants