Giter Site home page Giter Site logo

material-ui-responsive-table's Introduction

material-ui-next-responsive-table

npm Package

This project provides read-only responsive table for Material-UI.

Table is shown for desktop screen, list of expandable items - for tablet and mobile.

Demo

Installation

npm i --save material-ui-next-responsive-table

Usage

import ResponsiveTable from 'material-ui-next-responsive-table'

const columns = [
  {
    key: 'id',
    label: 'ID',
    primary: true,
  },
  {
    key: 'name',
    label: 'Name',
  },
  {
    key: 'authors',
    label: 'Author(s)',
    render: (value) => value.join(', ')
  },
]

const data = [
  {
    id: '1234',
    name: 'Foo',
    authors: ['Andy'],
  },
  {
    id: '4567',
    name: 'Bar',
    authors: ['Joe', 'Mike'],
  }
]

<ResponsiveTable
  columns={columns}
  data={data}
/>

ResponsiveTable Properties

Name Type Default Description
columns array Array of objects with
* Required column id (key) - used for detecting value for body cells
* Required column name (name) - shown in table header
* Optional render function (render: (value, column, row, data)) - allows to customize cell value for all cells in specific column
* Optional primary boolean (primary) - detects the column, which value has to be shown in the expandable list item summary (can be marked for 2 or more columns - in summary they are divided by .
data array Array of objects with keys that corresponds column id and value that should be shown in cell.
tableBreakpoints array ['md', 'lg', 'xl'] Override the breakpoints where the table is hidden.
listBreakpoints array ['xs', 'sm'] Override the breakpoints where the list is hidden.
noContentText string 'No Content' Override the default text if no columns/rows presented.

License

The files included in this repository are licensed under the MIT license.

material-ui-responsive-table's People

Contributors

gb96 avatar hrdymchl avatar lastlook avatar lehasvv2009 avatar severjason avatar swapnil95 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.