PHPackages                             hello-sebastian/react-table-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. hello-sebastian/react-table-bundle

ActiveSymfony-bundle[Utility &amp; Helpers](/categories/utility)

hello-sebastian/react-table-bundle
==================================

Symfony Bundle for React Table

v0.4.0(5y ago)080MITPHPPHP &gt;=7.2.5

Since Dec 29Pushed 5y ago1 watchersCompare

[ Source](https://github.com/HelloSebastian/react-table-bundle)[ Packagist](https://packagist.org/packages/hello-sebastian/react-table-bundle)[ RSS](/packages/hello-sebastian-react-table-bundle/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (5)Dependencies (5)Versions (6)Used By (0)

ReactTableBundle
================

[](#reacttablebundle)

**This Bundle provides *simple* [react-table](https://github.com/tannerlinsley/react-table/tree/v6) configuration for your Doctrine Entities.** With the option to create your own columns in JavaScript.

ReactTableBundle uses React Table v6. (React Table v7 is headless, means no CSS and layout. I'm not a CSS expert, so I'm still using v6 at the moment. Once a flex layout for v7 is ready, the bundle can be easily adapted, since the API for the columns is very similar.)

Highly inspired by [SgDatatablesBundle](https://github.com/stwe/DatatablesBundle).

**The project is currently still under development. It can not be excluded that configuration changes.**

When should I not use ReactTableBundle
--------------------------------------

[](#when-should-i-not-use-reacttablebundle)

ReactTableBundle is designed for simple tables that are strongly bound to the entities. If you are creating highly customized tables with many components and a lot of client-side programming, ReactTableBundle is not suitable for that. However, you can of course use ReactTableBundle alongside your complex tables.

Overview
--------

[](#overview)

1. [Features](#features)
2. [Installation](#installation)
3. [Your First Table](#your-first-table)
4. [Columns](#columns)
5. [Table Props Configuration](#table-props)
6. [Persistence Options Configuration](#persistence-options)

Features
--------

[](#features)

- Table Configuration in PHP
- Filtering\*
- Sorting\*
- Pagination\*
- Persist table state (sorting, filtering, current page, ...) in cookies
- Column Types: [TextColumn](#textcolumn), [BooleanColumn](#booleancolumn), [DateTimeColumn](#datetimecolumn), [ActionColumn](#actioncolumn)
- Custom Columns with [OwnColumn](#owncolumn)

\*server-side

Installation
------------

[](#installation)

### Step 1: Download the Bundle

[](#step-1-download-the-bundle)

Open a command console, enter your project directory and execute the following command to download this bundle:

```
$ composer require hello-sebastian/react-table-bundle
```

### Step 2: Enable the Bundle (without flex)

[](#step-2-enable-the-bundle-without-flex)

Then, enable the bundle by adding it to the list of registered bundles in the `config/bundles.php` file of your project:

```
// config/bundles.php

return [
    // ...
    HelloSebastian\ReactTableBundle\ReactTableBundle::class => ['all' => true],
];
```

### Step 3: Assetic Configuration

[](#step-3-assetic-configuration)

#### Install the web assets

[](#install-the-web-assets)

```
# if possible, make absolute symlinks (best practice) in public/ if not, make a hard copy

$ php bin/console assets:install --symlink
```

```
# make a hard copy of assets in public/

$ php bin/console assets:install
```

#### Add Assets into your base.html.twig

[](#add-assets-into-your-basehtmltwig)

```

```

Your First Table
----------------

[](#your-first-table)

### Step 1: Create a ReactTable class

[](#step-1-create-a-reacttable-class)

```
// src/ReactTable/UserTable.php
