UNPKG

@crossed/ui

Version:

A universal & performant styling library for React Native, Next.js & React

27 lines (26 loc) 538 B
import { autoUpdate, offset, useFloating as useDefault, size, shift } from "@floating-ui/react"; const useFloating = () => { return useDefault({ placement: "bottom-start", middleware: [ shift({ crossAxis: true }), offset(8), size({ apply({ rects: { reference }, elements: { floating } }) { floating.style.minWidth = `${reference.width}px`; } }) ], whileElementsMounted: autoUpdate }); }; export { useFloating }; //# sourceMappingURL=useFloating.web.js.map