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

react-simple-table-component

v1.1.8

Published

A simple table react component.

Readme

React Simple Table Component

A simple table React component with built-in sorting, searching, and pagination capabilities.

Features

  • 🔍 Search functionality across all columns
  • ↕️ Sortable columns
  • 📑 Pagination with customizable items per page
  • 🎨 Customizable styling through CSS classes
  • ⚡️ Tested with Vite and Create React App

Dependencies

The component has three types of dependencies:

Required Dependencies

These will be installed automatically when you install the package:

{
    "prop-types": ">=15.8.0",
    "str-case-converter": ">=1.0.4"
}

str-case-converter is my own utility package that handles string case conversions between different formats. In this component, it enables flexible name prop formatting by automatically converting the provided name to the appropriate case for CSS classes and display purposes.

Peer Dependencies

These are required to be installed in your project:

{
    "react": ">=18.0.0",
    "react-dom": ">=18.0.0"
}

Development Dependencies

These are only needed if you're contributing to the component's development:

{
    "@babel/core": "^7.26.0",
    "@babel/preset-env": "^7.26.0",
    "@babel/preset-react": "^7.26.3",
    "@rollup/plugin-babel": "^6.0.4",
    "@rollup/plugin-commonjs": "^25.0.0",
    "@rollup/plugin-node-resolve": "^16.0.0",
    "rollup": "^4.30.1",
    "rollup-plugin-sass": "^1.15.0",
    "sass": "^1.83.0"
}

Installation

npm install react-simple-table-component

Basic Usage

import Table from 'react-simple-table-component';

const MyComponent = () => {
    const data = [
        { id: 1, name: 'John Doe', age: 25 },
        { id: 2, name: 'Jane Smith', age: 30 },
        // ... more data
    ];

    return <Table name='users' data={data} itemsPerPage={20} />;
};

Props

There is no props required but it would only show an empty table without data.

Table Component

| Prop | Type | Required | Default | Description | | -------------- | ------ | -------- | ------- | -------------------------------------------------------- | | name | string | No | - | Unique identifier for the table, used in CSS class names | | data | array | No | - | Array of objects containing the data to be displayed | | itemsPerPage | number | No | 10 | Number of items to show per page |

Data Structure

The data prop should be an array of objects where each object represents a row in the table. The object keys will be used as column headers.

const data = [
    {
        id: 1,
        name: 'John Doe',
        email: '[email protected]',
        // ... other fields
    },
    // ... more rows
];

Features in Detail

Sorting

  • Click on any column header to sort by that column
  • Click again to toggle between ascending and descending order
  • Visual indicator shows current sort direction

Search

  • Search box filters across all columns
  • Case-insensitive search
  • Updates in real-time as user types

Pagination

  • Navigate through large datasets with Previous/Next buttons
  • Shows current page information
  • Displays total number of results
  • Default of 10 items per page

CSS Classes

The component uses BEM methodology for CSS classes. Here are the main classes available for styling:

.table {
    &__search {
        &-input {
        }
        &-icon {
        }
    }
    &__table {
        &__header-cell {
            &-content {
            }
            &-icon {
            }
        }
    }
    &__pagination {
        &-info {
        }
        &-controls {
        }
        &-button {
            &:disabled {
            }
            &:hover:not(:disabled) {
            }
        }
    }
    &__empty {
        &-message {
        }
    }
}

Customization

You can customize the appearance by overriding the default CSS classes. The table container will have a class name based on the name prop: ${name}__table.

Example:

.users__table {
    .table__search-input {
        border-radius: 4px;
        // ... other custom styles
    }
}