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

react-basic-table

v1.0.16

Published

[![npm version](https://badge.fury.io/js/react-basic-table.svg)](https://badge.fury.io/js/react-basic-table) [![npm](http://img.shields.io/npm/dm/react-basic-table.svg)](https://npmjs.org/package/react-basic-table) [![build status](https://travis-ci.org

Downloads

91

Readme

react-basic-table

npm version npm build status

React basic table is a basic table library which handles basic table functions like paging, sorting, and filtering for you.

Usage

To install react basic table using npm run:

npm install --save react-basic-table

Then use react basic table like below:

import ReactBasicTable from 'react-basic-table';
...
render() {
    var columns = ['Name', 'State', 'Age', 'Note'];
    var rows = [
        [
        <span>Joe</span>,
        <span>PA</span>,
        <span>22</span>,
        <input type="text" />
        ],
        [
        <span>Jim</span>,
        <span>TX</span>,
        <span>55</span>,
        <input type="text" />
        ]
    ];
    return <ReactBasicTable rows={rows} columns={columns} />
};

Props

| Prop | Description | Default | Example | | --- | --- | --- | --- | | rows | An array of rows. Every in this array is an array of components. This way you can render inputs and other components into the table. | [] | [[<span>Joe</span> ],[<span>John</span>]] | columns | An array of strings that are the names of the column. | [] | ['Name'] | | pageSize | The number of rows on a page. | 10 | 15 | | hideColumns | An array of column indexes that you want to hide. You can still filter on this column. | [] | [1] | | filter | An array of objects ({id, match}) that define filter criteria and column index. To use this you need to define a data-ReactBasicTable-value on the components in the row prop. This allows filtering on all components. | [] | [{id: 0, match: 'John'}] | | filterMode | An 'Or' or 'And' is accepting here. It is used in the filtering logic. In the case of 'Or' only one of the filter criteria needs to be true and in the case of 'And' they all need to be true. You can also pass 'Fuction' here to use advanced filtering logic declared in a function. See 'filterFunction' prop | 'Or' | 'And' | | filterFunction | A function used when 'filterMode' is 'Function'. This function takes an array of values and returns a bool if field passes the filter. (...values) => { return values[0] === 'OneA'; } | Empty function | (...values) => { return values[0] === 'OneA'; } | | sort | An array of column indexes that you want to be sortable. To use this you need to define a data-ReactBasicTable-value on the components in the row prop. This allows filtering on all components. | [] | [1] |

Examples

Please see the example directory for examples of all of available functionality. We also have a code pen here.