Repository navigation
✨ Features
- Headless
useDragResizehook (#57): the geometry engine ofWindow, now exported. Make any element draggable and resizable from any edge or corner, with the same units (px, vw, vh, %), min / max sizes, viewport or parent boundary,dragBounds, axis lock and keyboard resizing. Prop getters for the drag area (getDragHandleProps) and the handles (getResizeHandleProps(direction, { keyboard, label })), controlled or uncontrolled position and size,isDragging/isResizing.Windowitself is built on it. axisprop (#55):'x'or'y'locks the user's drag to one direction. The locked coordinate stays where the gesture started; programmatic moves are not restricted.- Keyboard resizing (#56): one handle per window (the bottom-right corner, the right edge when collapsed or
resizable="horizontal", the bottom edge forresizable="vertical") is a focusable WAI-ARIAseparatorwitharia-valuenow/aria-valuemin/aria-valuemax, andaria-valuetexton the corner. Arrow keys resize byresizeStep(10px), Shift + arrows byresizeShiftStep(50px), Home / End go to the min / max size. Each key press firesonResizeStart,onSizeChangeandonResizeEnd, and is persisted bypersistState. New props:withKeyboardResize,resizeStep,resizeShiftStep,resizeHandleLabel.
⚡ Improvements
- Behavior change: every resizable window gains one tab stop, its keyboard resize handle, with a visible focus mark (core's
FloatingWindow.ResizeHandleis focusable too). SetwithKeyboardResize={false}to keep the previous tab order. - Drag bounds use the window's rendered size, measured once per gesture.
- The comparison with Mantine core
FloatingWindowno longer has a core-only row: axis lock, keyboard resizing and a headless hook are now on both sides.
🐛 Bug Fixes
Windowforwards itsrefto the root element. A consumerrefused to replace the internal one, which broke container tracking withwithinPortal={false}.
What's Changed
- docs: add a comparison with Mantine core FloatingWindow by @gfazioli in #54
- feat: axis lock, keyboard resizing and a headless useDragResize hook by @gfazioli in #58
Full Changelog: 3.2.3...3.3.0