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

@nexys/mui-list

v2.6.2

Published

[![npm version](https://badge.fury.io/js/%40nexys%2Fmui-list.svg)](https://www.npmjs.com/package/@nexys/mui-list) [![npm version](https://img.shields.io/npm/v/@nexys/mui-list.svg)](https://www.npmjs.com/package/@nexys/mui-list) [![Build Package](https://g

Downloads

19

Readme

DataTable/List for Material UI (MUI) typescript

npm version npm version Build Package Deployment Average time to resolve an issue Percentage of issues still open Code style Bundlephobia

Multi-purpose data-table/business list for MUI

See here: https://nexys-system.github.io/mui-list-ts/

Relies on https://github.com/nexys-system/core-list

Get started

yarn install @nexys/mui-list

Minimal example

import {List, Types} from '@nexys/mui-list';

interface Animal {
  id: number;
  name: string;
  location: {id: number; name: string};
}

// list of data (here only one entry to make example more concise)
const data: Animal[] = [
  { id: 2, name: 'Sheep', location: {id: 2, name: 'Europe'} },
];

// prepare search options
const options = ['Africa', 'Europe'].map((value, i) => ({ key: i+1, value }));

// table definition
const def: Types.Definition<Animal> = [
  { name: 'name', filter: true, sort: true },
  {
    name: 'location',
    filter: {
      type: 'category',
      func: (a, b): boolean => b.includes(a.location.id),
      options
    },
    render: (x): string => x.location.name
  }
];

// list config
const config = { search: true, nPerPage: 3 }

export default (): JSX.Element => (
  <List data={data} def={def} config={config} />
);

API

all interfaces/types are described here: https://github.com/nexys-system/mui-list-ts/tree/master/src/lib/types

def

def defines the structure of the table and is an array of DefinitionItem<A>

name

column name/identifier (has to be included in A). In the simplest configuration, renders the value of A[name]

| Accepted Types: | Default Value | |---------------------|-------------------| | typeof A | - |

label

column label. In the simplest configuration. If not given, name is displayed.

| Accepted Types: | Default Value | |---------------------|-------------------| | string | name |

render

custom rendering, e.g. if A contains amount and the amount needs to be formatted: render: x => myCustomFormatFuntion(x.amount)

| Accepted Types: | |---------------------| | (x:A) => ReactElement |

filters

displays a column filter. The filter can be customized, see examples

| Accepted Types: | |---------------------| | Boolean + custom |

sort

displays a column sort.

| Accepted Types: | |---------------------| | Boolean + custom |

config

search

displays general search box

| Accepted Types: | Default Value | |---------------------|-------------------| | Boolean | false |

nPerPage

list of items per page

| Accepted Types: | Default Value | |---------------------|-------------------| | Int | 20 |

data

This is the content of the table.

| Accepted Types: | |---------------------| | A[] |

Examples

The source code for the examples can be found in: https://github.com/nexys-system/mui-list-ts/tree/master/src/list

References