Appearance
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
- Guide Overview - Learn how the guide section is organized and choose a starting path
- First Tooltip - Build your first floating surface step by step
- Build Popovers and Dropdowns - Add click, dismissal, and keyboard behavior
- Keep Content in View - Refine positioning with offset, flip, shift, and more
Positioning
useFloatingContext- Creates shared refs and open stateusePosition- Positions a floating element relative to an anchor elementuseArrow- Connects an arrow element to a floating contextuseClientPoint- Positions a floating element relative to pointer coordinates
Interactions
useClick- Opens and closes floating content on clickuseHover- Opens and closes floating content on hoveruseFocus- Opens and closes floating content on focususeFocusTrap- Keeps keyboard focus inside floating contentuseEscapeKey- Closes floating content when Escape is presseduseOutsideClick- Closes floating content when pointer input lands outsideuseRole- Synchronizes ARIA roles and states for floating surfaces
Collections
useCollection- Manages flat string-valued collections for keyboard navigationuseTree- Manages and coordinates flat list and hierarchical tree collectionsuseListNavigation- Moves active focus between items in a collection with the keyboard
Middleware
arrow- Aligns an arrow with the reference elementautoPlacement- Chooses a placement that fits available spaceflip- Switches to another placement when space is limitedhide- Exposes visibility state for clipped references and escaped floating elementsoffset- Adds distance between the reference and floating elementshift- Keeps the floating element within viewsize- Measures available space for sizing the floating element