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-table-component-package

v2.2.0

Published

A table component library where you can display, sort and filter a list

Downloads

26

Readme

React Table Component Package

A library for displaying, sorting, and filtering tables in React applications.

Installation

To install the library, use npm:

npm install react-table-component-package

Usage

Import the Table component into your application and use it as follows:

  import { Table, ColType, TableProps } from 'react-table-component-package';

  const data: User[] = [
    { id: 1, name: 'John Doe', age: 25, city: 'New York' },
    { id: 2, name: 'Jane Smith', age: 30, city: 'Los Angeles' },
    { id: 3, name: 'Tom Johnson', age: 28, city: 'Chicago' },
  ];

  const columns: ColType<User> = [
    { header: 'ID', key: 'id' },
    { header: 'Name', key: 'name' },
    { header: 'Age', key: 'age' },
    { header: 'City', key: 'city' },
  ];

  function App() {
    return (
      <div>
        <h2>User Table</h2>
        <Table data={data} columns={columns} />
      </div>
    );
  }

Accepted Props (TableProps)

  • data: An array of objects representing the data to display in the table.
  • columns: An array of objects defining the columns of the table with headers (header) and data keys (key).

Prerequisites

System Prerequisites

  • Node.js version 12 or higher.

Dependencies

To use react-table-component-package, make sure your project includes Tailwind CSS. Add the following to your tailwind.config.js to ensure Tailwind can process styles within the react-table-component-package library:

/** @type {import('tailwindcss').Config} */
export default {
  // other Tailwind CSS configurations
  content: [
    "./index.html",
    "./src/**/*.{js,ts,jsx,tsx}",
    "./node_modules/react-table-component-package/dist/**/*.{js,jsx,ts,tsx}"
  ],
  theme: {},
  plugins: [],
}

Add a file /types/react-table-component-package/index.d.ts inside your /src, with this content :

// types/react-table-component-package/index.d.ts
declare module 'react-table-component-package' {
  import { FC } from 'react';
  import { TableProps, ColType } from 'react-table-component-package/dist/react-table-component-package.es.js';

  export const Table: FC<TableProps>;
  export { TableProps, ColType };
}

API

  • Table: The main component to display a table.
  • ColType: Data type for the columns of the table.
  • TableProps: Props accepted by the Table component.

Contributions

Contributions are welcome! For any major changes, please open an issue for discussion or submit a pull request directly.

License

MIT

Support

For questions or issues, please open an issue on GitHub or email [email protected].