npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

mui-datatables-searchable-components2

v1.0.8

Published

Datatables for React using Material-UI

Downloads

3

Readme

MUI-Datatables - Datatables for Material-UI

Build Status Coverage Status dependencies Status npm version

MUI-Datatables is a data tables component built on Material-UI V1. It comes with features like filtering, view/hide columns, search, export to CSV download, printing, pagination, and sorting. On top of the ability to customize styling on most views, there are two responsive modes "stacked" and "scroll" for mobile/tablet devices.

Install

npm install mui-datatables --save

Demo

Edit react-to-print

Usage


import MUIDataTable from "mui-datatables";

const columns = ["Name", "Company", "City", "State"];

const data = [
 ["Joe James", "Test Corp", "Yonkers", "NY"],
 ["John Walsh", "Test Corp", "Hartford", "CT"],
 ["Bob Herm", "Test Corp", "Tampa", "FL"],
 ["James Houston", "Test Corp", "Dallas", "TX"],
];

const options = {
  filterType: 'checkbox',
};

<MUIDataTable 
  title={"Employee List"} 
  data={data} 
  columns={columns} 
  options={options} 
/>

API

<MUIDataTable />

The component accepts the following props:

|Name|Type|Description |:--:|:-----|:-----| |title|array|Title used to caption table |columns|array|Columns used to describe table. Must be an array of simple strings |data|array|Data used to describe table. Must be an array of simple strings |options|object|Options used to describe table

Options:

|Name|Type|Default|Description |:--:|:-----|:--|:-----| |styles|object||Extend or override default styling |filterType |string|'dropdown'|Choice of filtering view. Options are "checkbox" or "dropdown" |pagination|boolean|true|Enable/disable pagination |caseSensitive |boolean|false|Enable/disable case sensitivity for search |responsive|string|'stacked'|Enable/disable responsive table views. Options: 'stacked', 'scroll' |rowsPerPage|number|10|Number of rows allowed per page |rowsPerPageOptions|array|[10,15,20]|Options to provide in pagination for number of rows a user can select |rowHover|boolean|true|Enable/disable hover style over rows |sort|boolean|true|Show/hide sort icon from toolbar |filter|boolean|true|Show/hide filter icon from toolbar |search|boolean|true|Show/hide search icon from toolbar |print|boolean|true|Show/hide print icon from toolbar |download|boolean|true|Show/hide download icon from toolbar

Customize Styling

In the options object, you have the ability to customize styling to your liking with the 'styles' property. Here are the following sections you can customize:

Table of Contents

An example of how we would target FilterList would look like:


const options = {
  filter: true,
  filterType: 'checkbox',
  styles: {
    filterList: {
      root: {
        color: "#FF0000"
      },
      chip: {
        color: "#FEFEF0"
      },
    },
  }
};

<MUIDataTable 
  title={"some title"} 
  data={data} 
  columns={columns} 
  options={options} 
/>

Styling Table



const options = {
  styles: {
    table: {          
      head: {
        row: {
        },            
        cell: {
          root: {
          },
          sortLabel: {
          },
        }
      },
      body: {
        row: {
        },
        cell: {
          root: {
          }
        }
      },
    },
  }
};

Styling Toolbar



const options = {
  styles: {
    toolbar: {
      root: {},
      spacer: {
      },
      actions: {
      },
      titleRoot: {
      },
      titleText: {
      },
      icon: {
      },
      iconActive: {
      },
      search: {
      },
      searchIcon: {
      },
      searchText: {
      },
      clearIcon: {
      },
    },
  }
};

Styling FilterList



const options = {
  styles: {
    filterList: {
      root: {
      },
      chip: {
      },
    },
  }
};

Styling Pagination



const options = {
  styles: {  
    pagination: {
    }
  }
};

License

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