useInteractions
A hook to merge or compose interaction event handlers together.
Usage
The useInteractions
Svelte hook allows you to consume multiple interactions.
It ensures that event listeners from different hooks are properly registered instead of being overruled
by one another.
When you want to apply an event handler to an element that uses a props getter, make sure to pass it through the getter instead of applying it directly:
This will ensure all event handlers will be registered rather being overruled by each-other.
Returns
getReferenceProps | The merged attributes for the reference element. |
getFloatingProps | The merged attributes for the floating element. |
getItemProps | The merged attributes for when dealing with a list inside the floating element. |
Compare
Compare to Floating UI React.