# react-admin-customizable-datagrid

> ra-customizable-datagrid for React Admin

Latest version **1.0.1** (published 2023-01-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-admin-customizable-datagrid
pnpm add react-admin-customizable-datagrid
yarn add react-admin-customizable-datagrid
bun add react-admin-customizable-datagrid
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2023-01-13 |
| First published | 2023-01-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 5.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Fabiano Moraes |
| Maintainers | famoraes |

## Links

- npm: https://www.npmjs.com/package/react-admin-customizable-datagrid
- Repository: https://github.com/famoraes/ra-customizable-datagrid
- Homepage: https://github.com/famoraes/ra-customizable-datagrid#readme
- Issues: https://github.com/famoraes/ra-customizable-datagrid/issues
- npm.io page: https://npm.io/package/react-admin-customizable-datagrid

## Dependencies (4)

- [react](https://npm.io/package/react.md) ^18.2.0
- [lodash](https://npm.io/package/lodash.md) ^4.17.21
- [react-admin](https://npm.io/package/react-admin.md) ^4.7.0
- [@mui/icons-material](https://npm.io/package/@mui/icons-material.md) ^5.11.0

## Recent versions

- 1.0.1 (latest) — 2023-01-13
- 1.0.0 — 2023-01-13

## README

<h1 align="center">ra-customizable-datagrid for <a rel="noopener" target="_blank" href="https://github.com/marmelab/react-admin/">React Admin</a></h1>

<div align="center">

[React Admin](https://github.com/marmelab/react-admin/) plugin that allows to hide / show columns dynamically.

</div>

## Based on [fizix-io/ra-customizable-datagrid](https://github.com/fizix-io/ra-customizable-datagrid)
Project was moved to TypeScript and dependencies was updated.

## Features

* Users can show/hide columns, obviously
* Users preferences are stored by resource
* The storage mechanism can be replaced
* Developers can choose the default visible columns

## Installation

ra-customizable-datagrid is available from npm. You can install it (and its required dependencies) using:

```
$> npm install --save react-admin-customizable-datagrid
```
or
```
$> yarn add react-admin-customizable-datagrid
```

Then replace React Admin `Datagrid` by `CustomizableDatagrid`

```jsx
import CustomizableDatagrid from 'ra-customizable-datagrid';

const PostList = () => (
  <List>
    <CustomizableDatagrid>
      <TextField source="id" />
      <TextField source="title" />
    </CustomizableDatagrid>
  </List>
);
```

## Configuration

### Default columns

All the columns are visible by default.

This behavior can be changed with the `defaultColumns` prop. Just pass an array containing the name of the columns you want to be visible.

```jsx
import CustomizableDatagrid from 'ra-customizable-datagrid';

const PostList = props => (
  <List {...props}>
    <CustomizableDatagrid defaultColumns={['title']}>
      <TextField source="id" />
      <TextField source="title" />
    </CustomizableDatagrid>
  </List>
);
```

## License

`ra-customizable-datagrid` is licensed under the MIT License, sponsored and supported by <a href="https://fizix.io/" rel="noopener" target="_blank">Fizix</a>.

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