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

lbs-react-table

v0.1.3

Published

A table component made with React, with pagination, search and sorting. Works on small screens.

Readme

LB's react table (lbs-react-table)

A simple table component for React with

  • Pagination
  • Searching
  • Sorting
  • Responsiveness on narrow screens

Why

Several parts of making a table with pagination, filtering and sorting can be challenging

  • Dynamically generate a table from any data
  • Synchronyzing state for all elements (sorting, searching, pagination)
  • Tables responsiveness on narrow screens

Installation

$ npm install lbs-react-table  --save

Changelog

First release version.

This version is stable, but might not have been tested for all use cases so be sure to test your app to make sur the table works as you want.

Basic usage

This is the basic usage of lbs-react-table

import CustomReactTable from 'lbs-react-table/dist/customTable/customTable'

const data = [
	{"firstName": "Emily", "lastName": "Smith"},
	{"firstName": "Michael", "lastName": "Williams"},
	{"firstName": "Ashley", "lastName": "Brown"}
]

const fieldsSetup = [
	{ fieldName: 'FIRST NAME', fieldValue: 'firstName', fieldDisplay: 'firstName' },
	{ fieldName: 'LAST NAME', fieldValue: 'lastName', fieldDisplay: 'lastName' },
]

<CustomReactTable
	data={data}
	fieldsSetup={fieldsSetup}
	defaultSortingField='firstName'
	defaultSortingOrder='asc'
	paginationOptions={['3', '5', '10', '20']}
	defaultPaginationOption={'10'}
/>

Guide

Input data (data prop)

  • The data that you pass to the component in the data prop needs to follow the same format as in the example above.
  • You can pass any type of data but if you want to use it in the table for sorting, it needs to be a string.

Other example

const data = [
	{"email": "[email protected]", "age": "33", "color": "red"},
	{"email": "[email protected]", "age": "42", "color": "blue"},
	{"email": "[email protected]", "age": "28", "color": "red"}
]

Define what gets displayed (fieldsSetup prop)

  • Each object defines the header of the column, its displayed content, and its value for sorting (not for searching!)
  • We differentiate what is displayed and the actual value to manage specific case such as dates
  • You can display the date formatted as you want, but use the numeric value for sorting

Example of using different fieldValue and fieldDisplay for a column to sort dates in the table

const data = [
	{"firstName": "Emily", "dateOfBirth": "02/22/1982", "dateOfBirthString": "383180400000"},
	{"firstName": "Michael", "dateOfBirth": "08/11/1990", "dateOfBirthString": "650325600000"}
]

// this will make the sorting on birth date use the dateOfBirthString, but display the dateOfBirth in the table
const fieldsSetup = [
	{ fieldName: 'FIRST NAME', fieldValue: 'firstName', fieldDisplay: 'firstName' },
	{ fieldName: 'BIRTH DATE', fieldValue: 'dateOfBirthString', fieldDisplay: 'dateOfBirth' },
]

Other props

defaultSortingField :

Defines which fieldValue will be use to sort the data by default. If left empty, no sorting by default

defaultSortingOrder :

Can take values "asc" or "desc" to define the default sorting order, if a defaultSortingField is defined

paginationOptions:

Defines the options for the pagination dropdown menu. This lets users control how many results are displayed per page

defaultPaginationOption :

Defines which pagination option should be selected by default