Socket
Socket
Sign inDemoInstall

re-resizable

Package Overview
Dependencies
Maintainers
1
Versions
85
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

re-resizable

Resizable component for React.


Version published
Maintainers
1
Created

What is re-resizable?

The re-resizable npm package is a React component that allows you to create resizable components in your application. It provides a simple and flexible way to add resizable functionality to any element, with support for various resizing directions and customizable styles.

What are re-resizable's main functionalities?

Basic Resizable Component

This code demonstrates how to create a basic resizable component using the re-resizable package. The component starts with a default size of 200x200 pixels.

import React from 'react';
import { Resizable } from 're-resizable';

const BasicResizable = () => (
  <Resizable
    defaultSize={{
      width: 200,
      height: 200,
    }}
  >
    <div style={{ border: '1px solid black' }}>Resizable Content</div>
  </Resizable>
);

export default BasicResizable;

Resizable with Custom Styles

This example shows how to apply custom styles to the resizable component. The border is changed to a dashed blue line, and padding is added.

import React from 'react';
import { Resizable } from 're-resizable';

const StyledResizable = () => (
  <Resizable
    style={{
      border: '2px dashed blue',
      padding: '10px',
    }}
    defaultSize={{
      width: 300,
      height: 300,
    }}
  >
    <div>Styled Resizable Content</div>
  </Resizable>
);

export default StyledResizable;

Resizable with Specific Directions

This code demonstrates how to enable resizing in specific directions. In this example, resizing is enabled only on the right, bottom, and bottom-right corners.

import React from 'react';
import { Resizable } from 're-resizable';

const DirectionalResizable = () => (
  <Resizable
    enable={{
      top: false,
      right: true,
      bottom: true,
      left: false,
      topRight: false,
      bottomRight: true,
      bottomLeft: false,
      topLeft: false,
    }}
    defaultSize={{
      width: 400,
      height: 400,
    }}
  >
    <div>Directional Resizable Content</div>
  </Resizable>
);

export default DirectionalResizable;

Other packages similar to re-resizable

Keywords

FAQs

Package last updated on 12 Aug 2019

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc