Skip to content
On this page

API Reference

These pages define the public surface of VFloat. Use the guide pages for the mental model and workflows; use the API pages when you need exact signatures, options, defaults, and return values.

Start With The Guide

Positioning

  • useFloatingContext - Creates shared refs and open state
  • usePosition - Positions a floating element relative to an anchor element
  • useArrow - Connects an arrow element to a floating context
  • useClientPoint - Positions a floating element relative to pointer coordinates

Interactions

  • useClick - Opens and closes floating content on click
  • useHover - Opens and closes floating content on hover
  • useFocus - Opens and closes floating content on focus
  • useFocusTrap - Keeps keyboard focus inside floating content
  • useEscapeKey - Closes floating content when Escape is pressed
  • useOutsideClick - Closes floating content when pointer input lands outside
  • useRole - Synchronizes ARIA roles and states for floating surfaces

Collections

  • useCollection - Manages flat string-valued collections for keyboard navigation
  • useTree - Manages and coordinates flat list and hierarchical tree collections
  • useListNavigation - Moves active focus between items in a collection with the keyboard

Middleware

  • arrow - Aligns an arrow with the reference element
  • autoPlacement - Chooses a placement that fits available space
  • flip - Switches to another placement when space is limited
  • hide - Exposes visibility state for clipped references and escaped floating elements
  • offset - Adds distance between the reference and floating element
  • shift - Keeps the floating element within view
  • size - Measures available space for sizing the floating element
API Reference has loaded