1.1.10 • Published 2 years ago

vista-table-react v1.1.10

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

Vista Table React

Vista table react is React table component which can be setup very easily. One can simply use Vista table react and reduce the burden of writing lot many lines of javascript code to achieve table functionality.

Installation

$ npm i vista-table-react
$ yarn add vista-table-react

Key notes

  • Easy installation.
  • Quick customization.
  • Filter the data very easily, supports type like date, number.
  • Pagination
  • Classy look for the table.
  • Table with 3 themes available --> Classic, Dark and Basic
  • Coders Point Team is ready to help and resolve the issue whenever needed.

Implementation instructions

import React from "react";
import { VistaTable } from "vista-table-react";

const ReactComponent = () => {
    const SAMPLE_HEADER = [
        {key:"date_column", title: "Date", type: "date", format: "DD/MM/YYYY", sorting: false},
        {key:"column1", title: "Column 1", filter: false},
        {key:"column2", title: "Column 2", type: "number"},
        {key:"column3", title: "Column 3", filter: true}
    ];

    const CONFIG = {
        pagination: true,
        itemsPerPage: 8,
        filter: true,
        sorting: true
    }
    const SAMPLE_DATA = [
        {"date_column":"1/6/2021", "column1":"Test", "column2":5,"column3":"sample 1"},
        {"date_column":"2/6/2021", "column1":"Test1", "column2":6,"column3":"sample 2"},
        {"date_column":"3/6/2021", "column1":"Test2", "column2":7,"column3":"sample 2"},
    ];
    return (
        <VistaTable headers={SAMPLE_HEADER} data={SAMPLE_DATA} className="classic" config={CONFIG}/>
    );
}
export default ReactComponent;

Props details

PropsOject KeysAccepted ValuesDefault valuesDescription
#header#Array of ObjectArray of headers to be passed as props. Below is the accepted array key valye pairs
.keystringMandatory*unique value
.titlestringMandatory*title to show in the column name
.filterboolean -> true/falsetruefalse if filter is not needed for column
.sortboolean -> true/falsetruefalse if sorting is not required for column
.hiddenboolean -> true/falsefalsetrue if column need to be hidden (in-progress)
.typestring -> string, number, datestringtype of the column
.formatstringDD/MM/YYYYformat of the date if the type is date
#data# Array of objectArray of objects matching the key in header (key) --> {"key":""}
#classNamestringclassic/dark/emptystyle for the table "classic" for classic table, "" for basic table, "dark" for dark theme
#config# Object
.paginationboolean -> true/falsefalseset to true if Pagination is required
.itemsPerPagenumberMandatory* if pagination is truetells the number of rows per page
.filterboolean -> true/falsefalseset to true if filter is required for table
.sortingboolean -> true/falsefalseset to true if sorting is required for table

Demo

I'm sure I will develop a better demo page, but for now a simple demo page is here. to show the vista table look and feel.

Feel free to contact us for any help.

Contributors

Coderz Point

License

Licensed under MIT