GithubHelp home page GithubHelp logo

dennyabuti / material-ui-datatables Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hyojin/material-ui-datatables

1.0 2.0 0.0 299 KB

An another React Data tables component.

License: MIT License

JavaScript 99.09% HTML 0.77% CSS 0.15%

material-ui-datatables's Introduction

Material-UI-Datatables

npm Build Status Coverage Status

An another React Data tables component.
Material-UI-Datatables is a custom React component using awesome Material-UI. It provides filter and column sort and pagination features to display data mostly in desktop applications. You can check about the component in Google's guideline.

Installation

npm install material-ui-datatables

Demo

Demo

Status

Work in progress

Properties

Name Type Default Description
columns array
count number 0
data array
enableSelectAll bool false
filterHintText string 'Search'
height string 'inherit'
multiSelectable bool false
onCellClick function
onCellDoubleClick function
onFilterValueChange function Should set 'showHeaderToolbar' to true first
onNextPageClick function
onPreviousPageClick function
onRowSelection function
onRowSizeChange function
onSortOrderChange function
page number 1
rowSize number 10
rowSizeLabel string 'Rows per page:'
rowSizeList array [10, 30, 50, 100]
selectable bool false
showCheckboxes bool false
showHeaderToolbar bool false
summaryLabelTemplate function
title string Should set 'showHeaderToolbar' to true first
toolbarIconRight node Can be an array of IconButton nodes

Usage

import React, {Component} from 'react';
import DataTables from 'material-ui-datatables';

const TABLE_COLUMNS = [
  {
    key: 'name',
    label: 'Dessert (100g serving)',
  }, {
    key: 'calories',
    label: 'Calories',
  },
  ...
];

const TABLE_DATA = [
  {
    name: 'Frozen yogurt',
    calories: '159',
    fat: '6.0',
    carbs: '24',
    protein: '4.0',
    sodium: '87',
    calcium: '14%',
    iron: '1%',
  }, {
    name: 'Ice cream sandwich',
    calories: '159',
    fat: '6.0',
    carbs: '24',
    protein: '4.0',
    sodium: '87',
    calcium: '14%',
    iron: '1%',
  },
  ...
];

class MyComponent extends Component {
  ...
  render() {
    return (
      <DataTables
        height={'auto'}
        selectable={false}
        showRowHover={true}
        columns={TABLE_COLUMNS}
        data={TABLE_DATA}
        showCheckboxes={false}
        onCellClick={this.handleCellClick}
        onCellDoubleClick={this.handleCellDoubleClick}
        onFilterValueChange={this.handleFilterValueChange}
        onSortOrderChange={this.handleSortOrderChange}
        page={1}
        count={100}
      />
    );
  }
}

License

MIT

material-ui-datatables's People

Contributors

hyojin avatar

Stargazers

 avatar

Watchers

 avatar  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.