Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-rnd

Package Overview
Dependencies
Maintainers
1
Versions
96
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-rnd

  • 7.1.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
105K
decreased by-53.86%
Maintainers
1
Weekly downloads
 
Created

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 17 Sep 2017

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc