React Resizable screenshot

React Resizable

Updated: 25 Sep 2024
2505 Stars

A simple React component that is resizable with a handle.

Overview

The React-ResizableView is a simple widget that allows for easy resizing via handles. It provides two main components - <Resizable> and <ResizableBox for use in React applications. The widget provides flexibility and customization options for resizing components within a React application.

Features

  • Resizable Component: A raw component without state for use in building larger components.
  • ResizableBox Element: A simple <div> element managing basic state for easier use in simple cases.
  • Customizable Resize Handles: Ability to override and customize resize handles for more control over resizing behavior.

Installation

To install React-ResizableView, ensure compatibility with React 16.3 or higher. You can use either the <Resizable> or <ResizableBox> component based on your requirements. Import the necessary styles from /css/styles.css for proper handle placement and visibility. Additionally, options can be passed directly to the DraggableCore instance with the prop draggableOpts for enhanced customization.

Summary

The React-ResizableView offers a straightforward solution for implementing resizable components in React applications. With its two main components, <Resizable> and <ResizableBox, users have the flexibility to choose the level of customization needed for their resizing functionality. By following the installation steps and understanding the available props and customization options, developers can efficiently incorporate resizable elements into their React projects.