react-column-resizer
DefinitelyTyped icon, indicating that this package has TypeScript declarations provided by the separate @types/react-column-resizer package

1.1.9 • Public • Published

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 Name Type Default Value Description
disabled bool false Set to true if you want to disable resizing
minWidth number 0 The minimum width for the columns (in pixels)
className string "" 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

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.1.9809latest

Version History

VersionDownloads (Last 7 Days)Published
1.1.9809
1.1.81
1.1.71
1.1.61
1.1.51
1.1.41
1.1.31
1.1.21
1.1.11
1.1.01
1.0.91
1.0.81
1.0.71
1.0.61
1.0.51
1.0.41
1.0.31
1.0.21
1.0.11
1.0.01

Package Sidebar

Install

npm i react-column-resizer

Weekly Downloads

828

Version

1.1.9

License

GPL-3.0-only

Unpacked Size

44.7 kB

Total Files

5

Last publish

Collaborators

  • outstream