GithubHelp home page GithubHelp logo

niteshvishwakarma896 / react-datatable-io Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 1.21 MB

Creating React table library came out of necessity while developing a web application for a growing startup. You can sort, filter and download the data as excel from this react table. And yet more features and UI upgrades to come, feel free to add up your things and features to the table.

Home Page: https://niteshvishwakarma896.github.io/react-datatable-io/

License: MIT License

HTML 8.58% JavaScript 77.46% CSS 13.96%
react-datatable react-table react-data-table

react-datatable-io's Introduction

react-datatable-io

React-Datatable IO is a component which provide ability to create multifunctional table using single component like jQuery Datatable

NPM JavaScript Style Guide

Demo

Demo Link: https://niteshvishwakarma896.github.io/react-datatable-io/


Install

npm install --save react-datatable-io

DataTable Props

tableHeader: These will be headers that will be avaliable in the table header.
tableData: It will be an array of json data.
isSearchEnabled: To enable search functionality in the table.
isExport: To enable table data to be exported to excel,csv,json format file.
isTableToggle: To toggle table view to list or table.
tableStriped: Set table rows to be stripped as bootstrap table.
tableBordered: Set table rows to have a border as bootstrap table.
tableHover: Set table rows to hover when mouse is over.
tableResponsive: To make table responsive for the other devices.
tableHeaderStyle: Style your table header as you want, by passing the JSX styles.


To see more about it checkout below example.

Usage

import React from 'react'

import { ReactDataTableIO } from 'react-datatable-io'
import 'react-datatable-io/dist/index.css'

const App = () => {
  const data =[
    {"id":1,"fname":'Mark',"lname":"Otto","username":'@mdo',"date":'21-04-2000',"time":'21-04-2000',status:"Success"},
    {"id":2,"fname":'Nitesh',"lname":"Otto","username":'@mdo',"date":'21-04-2000',"time":'21-04-2000',status:"Success"},
    {"id":3,"fname":'Akash',"lname":"Otto","username":'@mdo',"date":'21-04-2000',"time":'21-04-2000',status:"Success"},
    {"id":4,"fname":'Smith',"lname":"Otto","username":'@mdo',"date":'21-04-2000',"time":'21-04-2000',status:"Success"},
    {"id":5,"fname":'Zolo',"lname":"Otto","username":'@mdo',"date":'21-04-2000',"time":'21-04-2000',status:"Success"},
    {"id":6,"fname":'Olo',"lname":"Otto","username":'@mdo',"date":'21-04-2000',"time":'21-04-2000',status:"Failed"},
    {"id":7,"fname":'Oark',"lname":"Otto","username":'@mdo',"date":'21-04-2000',"time":'21-04-2000',status:"Failed"},
    {"id":8,"fname":'Smark',"lname":"Otto","username":'@mdo',"date":'21-04-2000',"time":'21-04-2000',status:"Failed"},
    {"id":9,"fname":'Akark',"lname":"Otto","username":'@mdo',"date":'21-04-2000',"time":'21-04-2000',status:"Failed"},
    {"id":10,"fname":'Lark',"lname":"Otto","username":'@mdo',"date":'21-04-2000',"time":'21-04-2000',status:"Failed"},
    {"id":11,"fname":'Sneha',"lname":"Otto","username":'@mdo',"date":'21-04-2000',"time":'21-04-2000',status:"Failed"},
    {"id":12,"fname":'Neha',"lname":"Otto","username":'@mdo',"date":'21-04-2000',"time":'21-04-2000',status:"Failed"},
    {"id":13,"fname":'Manish',"lname":"Otto","username":'@mdo',"date":'21-04-2000',"time":'21-04-2000',status:"Failed"},
    {"id":14,"fname":'Naman',"lname":"Otto","username":'@mdo',"date":'21-04-2000',"time":'21-04-2000',status:"Failed"},
  ]
  const header =[
    { label: "#", key:"id" ,value: true, sortable: true  },
    { label: "First Name", key:"fname", value: true, sortable: true },
    { label: "Last Name", key:"lname", value: true, sortable: true },
    { label: "Username", key:"uname", value: true, sortable: true },
    { label: "Date", key:"date", value: true, sortable: true },
    { label: "Time", key:"time", value: true, sortable: true },
    { label: "Status", key:"status", value: true, sortable: true },
  ]
  return <ReactDataTableIO 
            tableData={data}
            tableHeader={header}
            isSearchEnabled={true}
            isExport={true}
            isTableToggle={true}
            tableStriped={false}
            tableBordered={false}
            tableHover={true}
            tableResponsive={true}
            tableHeaderStyle={{
              backgroundColor:"#232323",
              color:"#fff",
            }}
          />
}

export default App

License

MIT © NiteshVishwakarma896

react-datatable-io's People

Contributors

niteshvishwakarma896 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.