Table Resizer 📏
A flexible column resizing component for React Table Grid with touch support and accessibility features
Table Resizer 📏
The TableResizer
component provides column resizing functionality for the React Table Grid. It supports both mouse and touch interactions, with full accessibility features and customizable styling options.
Features ✨
- 🖱️ Mouse and touch support
- 📱 Responsive design
- ♿ Full accessibility support
- 🎨 Customizable styling
- ↔️ LTR/RTL support
- 🎯 Precise width control
Basic Usage
Props
Required Props
columnId
Unique identifier for the column being resized.
isResizing
Whether the column is currently being resized.
onResizeStart
Callback when resizing begins.
onResizeMove
Callback during resize movement.
onResizeEnd
Callback when resizing ends.
Optional Props
direction
Direction of resizing movement.
- Type:
"ltr" | "rtl"
- Default:
"ltr"
isDragging
Whether the resizer is being dragged.
- Type:
boolean
- Default:
false
width
Current width of the column.
- Type:
number
withoutTailwind
Use without Tailwind CSS styling.
- Type:
boolean
- Default:
false
Interaction Modes
Mouse Interaction
The resizer handles mouse events for desktop users:
Touch Interaction
Built-in touch support for mobile devices:
Styling
With Tailwind (Default)
Without Tailwind
Examples
Basic Column Resizer
RTL Support
With Resize Indicator
Accessibility ♿
The TableResizer component implements these accessibility features:
role="separator"
for proper semantic meaningaria-orientation="vertical"
to indicate directionaria-label
describing the column being resizedaria-valuenow
indicating current width- Keyboard support for resizing
- Focus management
- Touch device support
Best Practices 💡
- Always provide clear visual feedback during resizing
- Implement smooth animations for better UX
- Set appropriate minimum and maximum widths
- Handle both mouse and touch events
- Consider RTL layout support
- Maintain accessibility features
- Use resize indicators for better visibility
Integration with TableGrid
The TableResizer is typically used within the TableGrid component:
Related Components
Last updated on