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

@loganasherjones/beer-table

v0.1.1-alpha1

Published

MUI Tables for Beer Garden

Downloads

2

Readme

Beer Table

dependencies Status peerDependencies Status Build Status Coverage Status NPM Status

Beer Table is a simple Material-UI table wrapper for server and client side:

  • filtering
  • sorting
  • pagination

NOTE: This package is currently in alpha and is subject to aggressive API changes.

Install

npm install @loganasherjones/beer-table --save

Demo

TODO: once this is deployed, add a link to CodeSandbox

Usage

For a simple table:

import BeerTable from 'beer-table';

const columns = [
    { name: 'Name', id: 'name' },
    { name: 'Age', id: 'age' },
]

const data = [
    { name: 'Alice', age: 28},
    { name: 'Bob', age: 30},
    { name: 'Charles', age: 21},
]

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

For a more advanced use-case, checkout the examples.

API

WARNING: The API is likely to change until I am out of alpha. You have been warned.

<BeerTable />

|Name|Type|Required|Description| |----|----|--------|-----------| |data|array|true|Data to display, must be an array of objects. |columns|array|true|Column description. Must be an array of objects. See the columns below fore more information. |loading|boolean|false|Used to display a spinner while data is loading. |totalCount|number|false|Used to indicate the total number of rows, default is the data.length |filterCount|number|false|Used if filtering happens server-side. Indicates # of rows after filtering. |pagination|object|false|Used if pagination happens server-side. See info below.

columns

The columns help you customize a column's behavior. Options:

|Name|Type|Required|Default|Description| |----|----|--------|-------|-----------| |name|string|true|N/A|Name of the column |id|string|false|col.name|Identifies a column, also used as the accessor in data |formatter|func|false|null|Format a value before it is displayed. |filterValue|string|false|null|Set a filter value by default. |customSort|func|false|null| Used to customize the way sorting works. |sortDirection|string|false|null|Sort direction for this column. Only options are: desc or asc |disableSort|boolean|false|false|Disable sorting for this column. |defaultSortDirection|string|false|desc|On the first click to sort, which direction to sort. |customMatch|func|false|defaultMatch|A match function to use for filtering. See defaultMatch |filterEnum|array|false|null|A list of possible values for the filter. |disableFilter|boolean|false|false|Disable filtering on this column. |datetime|boolean|false|false|Determine if type of value is datetime.

pagination

The pagination can be used to customize the pagination displays.

|Name|Type|Required|Default|Description| |----|----|--------|-------|-----------| |currentPageNum|number|false|0|What page number to start from. |rowsPerPageOptions|array|false|[10, 25, 50, 100]|How many options for # of rows. |rowsPerPage|number|false|10|How many rows to show by default. Should be a member of rowsPerPageOptions

License

The files included in this repository are licensed under the MIT license

Road to Beta

I plan on getting all the following working before I make the API more stable.

Feature | Client | Server | Mobile ------- | ------ | ------ | ------ Filtering | :heavy_check_mark: | :x: | :x: Sorting | :heavy_check_mark: | :x: | :x: Pagination | :heavy_check_mark: | :x: | :x: Loading | :heavy_check_mark: | :heavy_check_mark: | :x: Error | :heavy_check_mark: | :heavy_check_mark: | :x: Empty | :heavy_check_mark: | :heavy_check_mark: | :x: Column Width | :x: | :x: | :x: