Socket
Socket
Sign inDemoInstall

react-rnd

Package Overview
Dependencies
2
Maintainers
1
Versions
93
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-rnd

Resizable and draggable component for React.


Version published
Weekly downloads
190K
increased by3.05%
Maintainers
1
Created
Weekly downloads
 

Package description

What is react-rnd?

The react-rnd package is a React component that allows you to create resizable and draggable elements. It is highly customizable and can be used to build complex user interfaces with ease.

What are react-rnd's main functionalities?

Draggable

This feature allows you to make any element draggable. The code sample demonstrates how to create a draggable component with default position and size.

import Rnd from 'react-rnd';

function DraggableComponent() {
  return (
    <Rnd
      default={{ x: 0, y: 0, width: 320, height: 200 }}
    >
      <div style={{ border: '1px solid black', padding: '10px' }}>
        Draggable Content
      </div>
    </Rnd>
  );
}

Resizable

This feature allows you to make any element resizable. The code sample demonstrates how to create a resizable component with resizing enabled on all sides and corners.

import Rnd from 'react-rnd';

function ResizableComponent() {
  return (
    <Rnd
      default={{ x: 0, y: 0, width: 320, height: 200 }}
      enableResizing={{ top: true, right: true, bottom: true, left: true, topRight: true, bottomRight: true, bottomLeft: true, topLeft: true }}
    >
      <div style={{ border: '1px solid black', padding: '10px' }}>
        Resizable Content
      </div>
    </Rnd>
  );
}

Draggable and Resizable

This feature allows you to make any element both draggable and resizable. The code sample demonstrates how to create a component that can be dragged and resized.

import Rnd from 'react-rnd';

function DraggableResizableComponent() {
  return (
    <Rnd
      default={{ x: 0, y: 0, width: 320, height: 200 }}
      enableResizing={{ top: true, right: true, bottom: true, left: true, topRight: true, bottomRight: true, bottomLeft: true, topLeft: true }}
    >
      <div style={{ border: '1px solid black', padding: '10px' }}>
        Draggable and Resizable Content
      </div>
    </Rnd>
  );
}

Other packages similar to react-rnd

Keywords

FAQs

Package last updated on 02 Sep 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc