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 🙏

© 2026 – Pkg Stats / Ryan Hefner

mui-react-tables

v1.1.2

Published

Tables for React with Material UI

Readme

Flexible data tables built on Material UI framework

npm version Build Status License: MIT


This project is an extension for Material UI Tables to provide features such as sorting and filtering.

Demo

Edit 6x4067oq7r

Install

npm i mui-react-tables

Usage

import React from "react";
import MUITable from "mui-react-tables";

function App() {
  const columns = [
    { title: "Id", property: "id", sort: true },
    { title: "Name", property: "name", filter: true },
    { title: "Job Title", property: "jobTitle", filter: true }
  ];

  const rows = [
    { id: 1, name: "Alex", jobTitle: "Developer" },
    { id: 2, name: "Mike", jobTitle: "Team Leader" },
  ];
  return (
      <MUITable columns={columns} rows={rows} />
  );
}

Props

| Name | Type | Description | | ------------ | ------------ | ------------ | | columns | array | Must be represented by an array of objects each of which describes the properties of a column. See below for details| | rows | array | Table rows | | onFilterChange | function | Callback function, called after changing filters for a column. Pass arguments to the callback function: column, active filter values for column. For exapmle: *(column, activeFilters) => { . ... } *| | onSortChange | function | Sorting callback function. Pass arguments to the callback function: column, direction. Direction: 'asc' or 'desc'|

Column options

| Name | Type | Description | | ------------ | ------------ | ------------ | | title | string | Required. Title of a column| | field | string | Path to the value in the current item. Mandatory property for provide sorting and filtering by column| | sort | boolean | Default: false. Indicates whether the sorting is available by column| | filter | boolean | Default: false. Indicates whether the filtering is available by column | | formatter | function | To customize of the data format. Pass arguments to the function: current value and row data. For example: (value, row) => { ... }. Should return content | | filterList | function/array | To customize filter values. | | filterPredicate | function | Custom filter method. Should return boolean | | filterType | function | Custom filter type. For example, if you want to filter a range of values you can define your own filter type (and predicate). See below for details

Custom filter type

The first point to use a custom filter type is to determine how to retrieve selected filter values ​​from your filter type. You must register a callback function that returns an array with the selected filter values ​​(called when the popover is closed). For example: this.props.registerSelectedFilters (() => {return 'array of selected filter values}}

Passed props to custom filter type:

| Name | Type | Description | | ------------ | ------------ | ------------ | | filter | object | Contains info about active filter values(filter.active), and filter values list (filter.list)| | columns | object | Info about column. See above | | registerSelectedFilters | function | For defining how to retrieve selected filter values after editing filter for column. See above|

Example custom filter type

import React from 'react';
import PropTypes from 'prop-types';

export class RangeNumberFIlter extends React.Component {

  static propTypes = {
    filter: PropTypes.object,  
    column: PropTypes.object.isRequired, 
    registerSelectedFilters: PropTypes.func,
  };

  componentDidMount() {
    this.props.registerSelectedFilters(() => {
      return [this.state.min, this.state.max];
    });
    this.setState({
      min: this.props.filter.active[0],
      max: this.props.filter.active[1],
    });
  }

  state = {
    min: null,
    max: null,
  };

  render() {
    return (
        <React.Fragment>
             ...
        </React.Fragment>
    );
  }
}

Contributing

Contributions are always welcome