# react-column-resizer

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

Latest version **1.1.9** (published 2019-06-15) · GPL-3.0-only license · 0 weekly downloads

## Install

```sh
npm install react-column-resizer
pnpm add react-column-resizer
yarn add react-column-resizer
bun add react-column-resizer
```

## Health

**Score 23/100 (F)** — status: abandoned.

Positive: has types package; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.9 |
| Published | 2019-06-15 |
| First published | 2018-07-28 |
| Weekly downloads | 0 |
| License | GPL-3.0-only |
| TypeScript types | separate (@types/react-column-resizer) |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 43.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 14 |
| Author | Nik M |
| Maintainers | outstream |
| Keywords | react, html, table, column, auto, resize |

## Links

- npm: https://www.npmjs.com/package/react-column-resizer
- Repository: https://github.com/nik-m2/react-column-resizer
- Homepage: https://github.com/nik-m2/react-column-resizer#readme
- Issues: https://github.com/nik-m2/react-column-resizer/issues
- npm.io page: https://npm.io/package/react-column-resizer

## Alternatives

- [@lexical/table](https://npm.io/package/@lexical/table.md) — 3.0M weekly downloads
- [mantine-datatable](https://npm.io/package/mantine-datatable.md) — 98.2K weekly downloads
- [react-native-collapsible-tab-view](https://npm.io/package/react-native-collapsible-tab-view.md) — 70.6K weekly downloads
- [@handsontable/vue3](https://npm.io/package/@handsontable/vue3.md) — 16.1K weekly downloads
- [vuewordcloud](https://npm.io/package/vuewordcloud.md) — 7.2K weekly downloads

## Recent versions

- 1.1.9 (latest) — 2019-06-15
- 1.1.8 — 2019-01-06
- 1.1.7 — 2019-01-01
- 1.1.6 — 2018-12-29
- 1.1.5 — 2018-12-28
- 1.1.4 — 2018-12-28
- 1.1.3 — 2018-12-28
- 1.1.2 — 2018-08-11
- 1.1.1 — 2018-08-04
- 1.1.0 — 2018-08-01
- 1.0.9 — 2018-07-28
- 1.0.8 — 2018-07-28
- 1.0.7 — 2018-07-28
- 1.0.6 — 2018-07-28
- 1.0.5 — 2018-07-28
- … 5 more at https://npm.io/package/react-column-resizer/versions

## README

## React Column Resizer [![npm version](https://badge.fury.io/js/react-column-resizer.svg)](https://badge.fury.io/js/react-column-resizer) [![Build Status](https://travis-ci.org/nik-m2/react-column-resizer.svg?branch=master)](https://travis-ci.org/nik-m2/react-column-resizer)

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`

<sup>* Requires `react` as a peer dependency: `npm install react`</sup>


```
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`

---
_Source: https://npm.io/package/react-column-resizer · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
