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

@vivekthebassist/material-table-component

v0.1.7

Published

A flexible and customizable table component built with React and Material-UI

Readme

React Material Table Component

npm version Downloads CI/CD

A customizable & responsive Material Design table component for React projects with advanced features like multi-level data display, sorting, filtering, pagination, and row selection.

Try the live demo using this codesandbox link here

Installation

The easiest way to use material-table-component is to install it from npm and build it into your app with Webpack.

npm install @keyvalue/material-table-component

This package includes Material-UI as a dependency, so you don't need to install it separately. However, you'll need to install React since it isn't included in the package.

Usage

Material Table Component can be used in its basic form by providing the columns and data props:

import { GenericTable } from '@keyvalue/material-table-component';

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

The columns prop is an array of column definitions with the following structure:

const columns = [
  {
    key: "name",
    label: "Name",
  },
  {
    key: "age",
    label: "Age",
  }
];

The data prop should be an array of objects matching the column keys:

const data = [
  {
    id: "row-1",
    name: 'John Doe',
    age: 30,
    children: [] // Optional children for multi-level tables
  },
  {
    id: "row-2",
    name: 'Jane Smith',
    age: 25,
    children: []
  }
];

Multi-Level Table Example

The component supports multi-level data display with parent-child relationships:

<GenericTable
  data={[
    {
      id: "parent-1",
      investor: "Parent Company",
      grossInvestment: -1000000,
      children: [
        {
          id: "child-1",
          investor: "Subsidiary A",
          grossInvestment: -600000,
          children: []
        },
        {
          id: "child-2",
          investor: "Subsidiary B",
          grossInvestment: -400000,
          children: []
        }
      ]
    }
  ]}
  columns={[
    {
      key: "investor",
      label: "Investor",
    },
    {
      key: "grossInvestment",
      label: "Investment",
    }
  ]}
  meta={{
    chartType: "MULTI_LEVEL_TABLE",
    columns: [
      {
        id: "investor",
        name: "Investor",
        type: "string",
      },
      {
        id: "grossInvestment",
        name: "Investment",
        type: "currency",
        currencyFormat: {
          currency: "dollar",
          scale: 2,
        },
      }
    ]
  }}
/>

Props

Props that can be passed to the component are listed below:

Column Types and Formatting

The meta.columns property allows you to specify the type and formatting for each column:

meta={{
  chartType: "MULTI_LEVEL_TABLE",
  columns: [
    {
      id: "name",
      name: "Name",
      type: "string",
    },
    {
      id: "amount",
      name: "Amount",
      type: "currency",
      currencyFormat: {
        currency: "dollar",
        scale: 2,
      },
    },
    {
      id: "percentage",
      name: "Percentage",
      type: "percentage",
      scale: 2,
    },
    {
      id: "date",
      name: "Date",
      type: "date",
      dateFormat: "MM/DD/YYYY",
    }
  ]
}}

Supported column types include:

  • string - Text data
  • number - Numeric data
  • currency - Monetary values with currency formatting
  • percentage - Percentage values
  • date - Date values with formatting options
  • boolean - True/false values

Row Actions

You can define actions that appear for each row:

actions={[
  {
    label: "View Details",
    icon: "visibility",
    action: (rowId) => handleViewDetails(rowId),
    condition: (rowId) => hasDetails(rowId)
  },
  {
    label: "Edit",
    icon: "edit",
    action: (rowId) => handleEdit(rowId)
  }
]}

Style Customizations

You can customize the appearance of the table using the style props:

<GenericTable
  columns={columns}
  data={data}
  tableHeaderStyles={{
    background: "#1a237e",
    color: "#ffffff",
    fontSize: "1rem",
  }}
  tableCellStyles={{
    padding: "12px 16px",
  }}
  rowColors={["#f5f5f5", "#ffffff"]}
/>

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.