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

react-resizable-panels

Package Overview
Dependencies
Maintainers
1
Versions
110
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-resizable-panels

React components for resizable panel groups/layouts

  • 2.0.16
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created

What is react-resizable-panels?

The react-resizable-panels package allows developers to create resizable panel layouts in React applications. It provides a flexible and easy-to-use API for creating panels that users can resize by dragging the edges.

What are react-resizable-panels's main functionalities?

Basic Resizable Panel

This code demonstrates how to create a basic resizable panel layout with two panels. Users can resize the panels by dragging the divider between them.

import { Panel, PanelGroup } from 'react-resizable-panels';

function App() {
  return (
    <PanelGroup>
      <Panel>
        <div>Panel 1</div>
      </Panel>
      <Panel>
        <div>Panel 2</div>
      </Panel>
    </PanelGroup>
  );
}

Nested Resizable Panels

This code demonstrates how to create nested resizable panels. The second panel contains a vertical PanelGroup with two nested panels, allowing for more complex layouts.

import { Panel, PanelGroup } from 'react-resizable-panels';

function App() {
  return (
    <PanelGroup>
      <Panel>
        <div>Panel 1</div>
      </Panel>
      <Panel>
        <PanelGroup direction="vertical">
          <Panel>
            <div>Panel 2.1</div>
          </Panel>
          <Panel>
            <div>Panel 2.2</div>
          </Panel>
        </PanelGroup>
      </Panel>
    </PanelGroup>
  );
}

Customizing Panel Sizes

This code demonstrates how to customize the sizes of the panels. The first panel has a default size of 30%, a minimum size of 20%, and a maximum size of 50%. The second panel has a default size of 70%, a minimum size of 50%, and a maximum size of 80%.

import { Panel, PanelGroup } from 'react-resizable-panels';

function App() {
  return (
    <PanelGroup>
      <Panel defaultSize={30} minSize={20} maxSize={50}>
        <div>Panel 1</div>
      </Panel>
      <Panel defaultSize={70} minSize={50} maxSize={80}>
        <div>Panel 2</div>
      </Panel>
    </PanelGroup>
  );
}

Other packages similar to react-resizable-panels

FAQs

Package last updated on 24 Mar 2024

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