1.0.7 • Published 11 months ago

react-table-modal v1.0.7

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

react-modal

  • react-modal is a versatile and accessible modal dialog component for React, providing a straightforward way to create customizable modal popups in applications.

Table of Contents

Installation

To install, you can use npm or yarn:

$ npm install --save react-table-modal
$ yarn add react-table-modal

Getting Started

This is an example of how you may give instructions on setting up your project locally. To get a local copy up and running follow these simple example steps.

npm start

Prerequires

npm install

Examples

Here is a simple example of react-modal being used in an app with some custom styles and focusable input elements within the modal content:

import React from 'react'
import { DataTable } from 'react-table-modal'
import 'react-table-modal/dist/index.css'

const App = () => {
  return (
    <DataTable
      theme="blue"
      editButton={true}
      editField={["name", "family", "retired"]}
      deleteButton={true}
      cols={["name", "family", "retired"]}
      data={[
        { name: "ali", family: "rezaei", retired: 'Yes' },
        { name: "reza", family: "alinia", retired: 'No' },
        { name: "mehdi", family: "hoseini", retired: 'Yes' },
        { name: "amin", family: "amiri", retired: 'Yes' },
        { name: "mehran", family: "kazemi", retired: 'No' },
      ]}
    />
  )
}

export default App

Attributes

NameTypeDescription
themestringThis feature sets the table color theme.
editButtonbooleanEnabling this feature adds an edit button to each row.
editFieldarraySpecifies the editable fields.
deleteButtonbooleanAbility to add a delete button to each row of the table.
colsarraySpecifies the columns to be displayed in the table.
rowsPerPageobjectThe table displays the number of rows per page.
dataarrayA collection of data.

DataTable

The DataTable component is used to display tabular data with specific features.

Features

Theme Examples

Below are examples of the available themes along with their respective class names and images:

Default Theme

<DataTable theme="default" ... />

Blue Theme

<DataTable theme="blue" ... />

Red Theme

<DataTable theme="red" ... />

Green Theme

<DataTable theme="green" ... />

Demos

There are several demos hosted on CodePen which demonstrate various features of react-table-modal:

License

MIT © alireza-ramzanpour

1.0.7

11 months ago

1.0.6

11 months ago

1.0.5

11 months ago

1.0.4

11 months ago

1.0.3

12 months ago

1.0.2

12 months ago

1.0.1

12 months ago

1.0.0

1 year ago