Socket
Book a DemoInstallSign in
Socket

mui-datatables-searchable-components2

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mui-datatables-searchable-components2

Datatables for React using Material-UI

1.0.8
latest
Source
npmnpm
Version published
Weekly downloads
2
Maintainers
1
Weekly downloads
 
Created
Source

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:

NameTypeDescription
titlearrayTitle used to caption table
columnsarrayColumns used to describe table. Must be an array of simple strings
dataarrayData used to describe table. Must be an array of simple strings
optionsobjectOptions used to describe table

Options:

NameTypeDefaultDescription
stylesobjectExtend or override default styling
filterType string'dropdown'Choice of filtering view. Options are "checkbox" or "dropdown"
paginationbooleantrueEnable/disable pagination
caseSensitive booleanfalseEnable/disable case sensitivity for search
responsivestring'stacked'Enable/disable responsive table views. Options: 'stacked', 'scroll'
rowsPerPagenumber10Number of rows allowed per page
rowsPerPageOptionsarray[10,15,20]Options to provide in pagination for number of rows a user can select
rowHoverbooleantrueEnable/disable hover style over rows
sortbooleantrueShow/hide sort icon from toolbar
filterbooleantrueShow/hide filter icon from toolbar
searchbooleantrueShow/hide search icon from toolbar
printbooleantrueShow/hide print icon from toolbar
downloadbooleantrueShow/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.

Keywords

material-ui

FAQs

Package last updated on 23 Feb 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.