Table editor

React Bootstrap 5 Table editor plugin

Table Editor is a useful tool for displaying and managing data. The component works similarly to the React Datatable (docs) with an additional column for action buttons.

Responsive interactive built with the latest Bootstrap 5. Creates editable tables. Delete or edit rows directly or via modal editor.

Note: Read the API tab to find all available options and advanced customization


Basic example

You can initialize the component with MDBTableEditor.


Company Address Employees
Smith & Johnson Park Lane 2, London 30
P.J. Company Oak Street 7, Aberdeen 80
Food & Wine Netherhall Gardens 3, Hampstead 12
IT Service Warwick Road 14, London 17
A. Jonson Gallery Oaklands Avenue 2, London 4
F.A. Architects Frognal Way 7, Hampstead 4

Modal

To change the default editing mode (inline) to the modal version, set property modal to true.



Inputs example

Table Editor supports several input types - for example, if you wish to force a user to enter only Boolean values in one column, you can set its inputType to a checkbox.

Supported input types:

  • Text (default)
  • Number
  • Checkbox - displays a checkbox in edit mode and true/false value otherwise
  • Select - additionally requires an array of options


Disable edit

You can disable editing for a table by setting its editable property to false. A user won't be able to change its value in the edit mode.




Async data

While awaiting data from API, you can prevent a user from interacting with Table Editor by managing loading property.



Dark

Dark mode can be applied to both modal and inline versions - firstly, add a CSS class which changes the background color to your page. Secondly, pass the same class name to the color option of your Table Editor (f.e. 'bg-dark'). Now change the font to light by setting dark attribute to true.


Company Address Employees
Smith & Johnson Park Lane 2, London 30
P.J. Company Oak Street 7, Aberdeen 80
Food & Wine Netherhall Gardens 3, Hampstead 12
IT Service Warwick Road 14, London 17
A. Jonson Gallery Oaklands Avenue 2, London 4
F.A. Architects Frognal Way 7, Hampstead 4

Table editor - API


Import


        import { MDBTableEditor } from 'mdb-react-ui-kit';
      

Properties

MDBTableEditor

Name Type Default Description Example
modal Boolean false Sets the mode to modal <MDBTableEditor modal />
bordered Boolean false Adds borders to a TableEditor <MDBTableEditor bordered />
borderless Boolean false Removes all borders from a TableEditor <MDBTableEditor borderless />
borderColor String Changes a border color to one of main colors <MDBTableEditor borderColor='red' />
clickableRows Function Makes rows clickable <MDBTableEditor clickableRows={() => console.log('click')} />
color String Adds a color class to a TableEditor (f.e 'bg-dark') <MDBTableEditor color='primary' />
dark Boolean false Changes a font color to white <MDBTableEditor dark />
className String '' Add custom class to MDBTableEditor <MDBTableEditor className="class" />
entries Number 10 Number of visible entries (pagination) <MDBTableEditor entries={25} />
entriesOptions Array [10, 25, 50, 200] Options available to choose from in a pagination select (rows per page) <MDBTableEditor entriesOptions=[10, 20, 60] />
fixedHeader Boolean false When it's set to true, the table's header will remain visible while scrolling <MDBTableEditor fixedHeader />
fullPagination Boolean false Displays additional buttons for the first and last pages <MDBTableEditor fullPagination />
hover Boolean false Changes the background color of a hovered row <MDBTableEditor hover />
loading Boolean false Sets the loading mode - disables interactions and displays a loader <MDBTableEditor loading />
loaderClass String 'bg-primary' The class name for a loader (loading mode) <MDBTableEditor loaderClass='bg-warning' />
loadingMessage String 'Loading results...' A message displayed while loading data <MDBTableEditor loaderClass='Loading...' />
maxWidth String Sets a maximum width of a TableEditor - can be either a string ('10%') or a number of pixels. <MDBTableEditor maxWidth='560px' />
maxHeight Number|String Sets a maximum height of a TableEditor - can be either a string ('10%') or a number of pixels. <MDBTableEditor maxHeight='560px' />
selectable Boolean false Enables selecting rows with checkboxes <MDBTableEditor selectable />
selectedRows Array Contains selected data <MDBTableEditor selectedRows={selectedRows} />
setSelectedRows Function Sets selected data <MDBTableEditor setSelectedRows={setSelectedRows} />
multi Boolean false Allows selecting multiple rows (selectable mode) <MDBTableEditor selectable multi />
noFoundMessage String 'No matching results found' A message displayed when a table is empty <MDBTableEditor noFoundMessage='Not found...' />
pagination Boolean true Shows/hides the pagination panel <MDBTableEditor pagination={false} />
sm Boolean false Decreases a row's paddings <MDBTableEditor sm />
striped Boolean false Slightly changes the background's color in every other row <MDBTableEditor striped />
rowsText String 'Rows per page': A text indicating a number of rows per page <MDBTableEditor rowsText='Rows:' />
search Boolean false Enables search in the table <MDBTableEditor search />
sortField String '' Allows default sorting of the table column <MDBTableEditor sortField='ColumnName' />
sortOrder String 'asc' Defines the default sorting direction <MDBTableEditor sortField='ColumnName' sortOrder='desc' />
advancedSearch Boolean false Enables advanced search in the table <MDBTableEditor advancedSearch />
tag String 'table' Defines tag of the MDBTableEditor element <MDBTableEditor tag="section" />