Socket
Socket
Sign inDemoInstall

react-column-resizer

Package Overview
Dependencies
0
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    react-column-resizer

Place in between `td` tags to automatically add resizing functionality.


Version published
Maintainers
1
Install size
44.6 kB
Created

Readme

Source

React Column Resizer npm version Build Status

Place in between td tags to add resizing functionality. Works with touch and mouse events.

Demo: https://codesandbox.io/s/1olmx0q4w7

Usage:

npm install react-column-resizer

* Requires react as a peer dependency: npm install react

import React from "react";
import { render } from "react-dom";
import ColumnResizer from "react-column-resizer";

const App = () => (
  <div>
    <table>
      <tbody>
        <tr>
          <td>1</td>
          <ColumnResizer className="columnResizer" minWidth={0} />
          <td>2</td>
        </tr>

        <tr>
          <td>3</td>
          <td />
          <td>4</td>
        </tr>
      </tbody>
    </table>
  </div>
);

render(<App />, document.body);

Props

Prop NameTypeDefault ValueDescription
disabledboolfalseSet to true if you want to disable resizing
minWidthnumber0The minimum width for the columns (in pixels)
classNamestring""Any custom classes. If set, default width and backgroundColor styles will not be applied

Limitations

  • You have to put filler <td/>'s in rows you don't use the resizer
  • The resizer needs to be wide enough to actually grab. To do this while maintaining a thin bar, set the background color to transparent and assign a value to border-left

Keywords

FAQs

Last updated on 15 Jun 2019

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc