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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@chloeadriancreates/custom-react-table

v1.1.8

Published

A React component to display a custom table based on data provided.

Readme

Banner

Custom React Table

Need a light, customizable, and easy-to-use table component to display data in your React app? Look no further!
This ~18kb React component allows you to display complex data in a clean, accessible table, complete with pagination, a search system, and sorting by each category. Let’s dive right in!

Table screenshot

Prerequisites

Getting started

Installation

npm install @chloeadriancreates/custom-react-table

Usage

import { useState } from "react";
import { Table } from "@chloeadriancreates/custom-react-table";

const YourComponent = () => {
  const [content, setContent] = useState([
    {
      animal: "manatee",
      color: "turquoise",
      food: "pizza"
    },
    {
      animal: "deer",
      color: "lavender",
      food: "sushi"
    }
  ]);

  return <Table content={content} />;
};

The only required prop is content, which takes an array of objects, with each object representing a table row and each key a column.


Further customization

The Table component offers several options to make it fit seamlessly into your app’s design and data structure.

🎨 Colors

A color theme is calculated based on one main color, which by default is a medium warm grey.

You can easily customize it to fit your app’s design system by passing a hex code (3 or 6 characters) to the color prop.

The font inherits from the parent component, so you can simply set the font-family where you use the table.

<Table content={content} color="#577399" />

📅 Date format

The Table component automatically detects ISO date strings and formats them with Day.js.

By default, the format is "DD/MM/YYYY", but you can customize it by passing any valid Day.js format token to the dateFormat prop.

<Table content={content} dateFormat="MM/DD/YY" />

🧩 Object flattening

If a row in your table (each object in content) contains another object, you can choose which nested property to display.

For example:

{
  color: "purple",
  animals: { 
    pastFavorite: "unicorn", 
    currentFavorite: "panda" 
  }
}

You can tell the table which property to show by using the objectKey prop:

<Table content={content} objectKey={{ animals: "pastFavorite" }} />

The objectKey object can contain as many properties as your content includes.
However, this is only one level deep: further nested objects or arrays are not supported yet.


Accessibility

The component is built with accessibility in mind:

  • Semantic HTML table structure
  • Keyboard navigation for pagination and sorting
  • Visible focus states based on your color theme
  • ARIA attributes (aria-sort) for screen readers

Future updates

These are some planned improvements:

  • Support for arrays inside row objects
  • Responsive/mobile layout

Thanks for reading, and happy coding!
Chloé Adrian ✨