use Focus
Opens the floating element while the reference element has focus,
like CSS :focus
.
To manage focus within the floating element itself, use
FloatingFocusManager
.
Usage
This Hook returns event handler props.
To use it, pass it the context
object returned from
useFloating()
, and then feed its result into the
useInteractions()
array. The returned prop getters are
then spread onto the elements for rendering.
Props
enabled
default: true
Conditionally enable/disable the Hook.
visibleOnly
default: true
Whether the open state only changes if the focus
event is considered visible (:focus-visible
CSS selector).