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

material-ui-grouped-table

v1.0.1

Published

Grouped Table Based on Material UI for ReactJS

Downloads

3

Readme

NPM Edit on Codesandbox

Installation

npm

npm i material-ui-grouped-table --save

yarn

yarn add material-ui-grouped-table

Usage


import React from 'react';
import GroupedColumnTableComponent from "material-ui-grouped-table";

export default function App() {
  return (
    <div className="App">
      <GroupedColumnTableComponent rows={[]} columns={[]} />
    </div>
  );
}

Example Component

Data

The Data interface represents an object with dynamic keys and values, with the values being of any type. It has the following structure:

| Name | Type | Description | | --- | --- | --- | | key | string | An object with dynamic keys and values. |

Note that the key in the interface definition represents any string key name that you might use to define properties in the object.

GroupedColumn

The following properties can be passed to the GroupedColumn object:

| Name | Type | Default | Description | | --- | --- | --- | --- | | label | string | | The display name for the column. | | id | string | undefined | A unique identifier for the column. | | minWidth | number | undefined | The minimum width for the column. | | align | 'right' | 'left' | 'center' | 'left' | The alignment of the column content. | | format | (value: any) => React.ReactNode | undefined | A function that formats the content of the column. | | color | (value: any) => string | undefined | A function that returns the color of the column content. | | onClick | (value: any) => void | undefined | A callback function triggered when a column is clicked. It passes the value of the clicked column as an argument. | | navigateTo | (value: any) => string | undefined | A function that returns the URL to navigate to when a column is clicked. | | width | string | number | undefined | The width of the column. | | children | GroupedColumn[] | undefined | An array of GroupedColumn objects representing child columns. | | columnSxProps | SxProps | undefined | Sx Props for customizing the column. |

GroupedTableProps

The following props can be passed to the GroupedTable component:

| Name | Type | Default | Description | | --- | --- | --- | --- | | rows | Data[] | null | Data for Table | | columns | GroupedColumn[] | null | The Columns for the Table | | onClick | (value: Data) => void | undefined | Callback function triggered when a row is clicked. It passes the value of the clicked row as an argument. | | enableSort | boolean | undefined | Boolean indicating whether the table should be sortable. | | enableBorders | boolean | undefined | Boolean indicating whether the table should have borders. | | ellipsis | boolean | undefined | Boolean indicating whether text in the table should be truncated with an ellipsis. | | fixedHeight | number | undefined | Number representing the height of the table. | | enableFilters | boolean | undefined | Boolean indicating whether the table should display filtering options. | | filterChanges | (value: IGenericObject) => void | undefined | Callback function triggered when a filter is changed. It passes an object containing the current filter values as an argument. | | enableCheckBox | boolean | undefined | Boolean indicating whether the table should display checkboxes. | | checkBoxChange | (data: readonly string[]) => void | undefined | Callback function triggered when a checkbox is changed. It passes an array of the checked rows as an argument. | | checkboxSelector | string | undefined | String representing the column to display checkboxes in. |

Built With

  • React - A JavaScript library for building user interfaces

  • Material UI - Component Library for Material UI

License

MIT Licensed. Copyright (c) Vishal Ramanand Sharma 2023.