1.0.12 ā€¢ Published 5 months ago

ebo-react-datatable v1.0.12

Weekly downloads
-
License
ISC
Repository
github
Last release
5 months ago

Banner

DataTablePlugin

DataTablePlugin is a custom React component, part of the last project on the OpenClassrooms Front-End learning path. It's designed to display, sort, filter, paginate, manage tabular data efficiently and publish it as a NPM package.

Table screenshot

Prerequisites

Getting started

Installation

    npm install ebo-react-datatable

Usage

import DataTablePlugin from 'ebo-react-datatable';
import 'ebo-react-datatable/src/DataTablePlugin.css';

// Define data and columns
const data = [{...}, {...}];
const columns = [{ title: 'First Name', key: 'firstName' }, ...];

function App() {
    return <DataTablePlugin data={data} columns={columns} dateFormat="yyyy-mm-dd" />;
}

The DataTablePlugin component takes the following props:

data: An array of objects representing the rows in the table. columns: An array of objects representing the columns in the table. Each object should have a title (the column header) and a key (the key in the data that this column should display). dateFormat: A string representing the format of the dates in the table. Default is 'dd/mm/yyyy'. available formats: 'dd/mm/yyyy' 'mm/dd/yyyy' 'yyyy/mm/dd' 'dd-mm-yyyy' 'mm-dd-yyyy' 'yyyy-mm-dd' 'dd.mm.yyyy' 'mm.dd.yyyy' 'yyyy.mm.dd' ISO --> (yyyy-mm-ddThh:mm:ss)

exemple:

const columns = [
  { title: "First Name", data: "firstName" },
  { title: "Last Name", data: "lastName" },
  { title: "Start Date", data: "startDate" },
  { title: "Department", data: "department" },
  { title: "Date of Birth", data: "dateOfBirth" },
  { title: "Street", data: "street" },
  { title: "City", data: "city" },
  { title: "State", data: "state" },
  { title: "Zip Code", data: "zipCode" },
];

const users = [
  {
    firstName: "Patrick",
    lastName: "Ward",
    dateOfBirth: "07/04/1987",
    startDate: "12/28/2022",
    department: "Finance",
    street: "160 Michael Garden",
    city: "Singhberg",
    state: "AZ",
    zipCode: "65578",
  },
];
return <DataTablePlugin data={users} columns={columns} dateFormat="mm/dd/yyyy" />;

āœØ Features and Interface The component offers functionalities like sorting, searching and pagination with an intuitive UI.

šŸ“ License This project is licensed under the MIT License.

šŸ‘Øā€šŸ’» Author This project was created by Eric Bouillaut.

1.0.12

5 months ago

1.0.10

5 months ago

1.0.9

5 months ago

1.0.8

5 months ago

1.0.7

5 months ago

1.0.6

5 months ago

1.0.5

5 months ago

1.0.4

5 months ago

1.0.3

5 months ago

1.0.2

5 months ago