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-data-list-table-component

v0.2.3

Published

React table component with pagination, search and sorting

Downloads

27

Readme

React Data Table Component

npm version Downloads

A React table component with search, pagination and select entries

Installation

The package can be installed via npm:

npm install react-data-list-table-component

Or via yarn:

yarn add react-data-list-table-component

How to use

import React from "react";
import { Table } from "react-data-list-table-component";

const render = () => {
  const data = [
    {
      firstName: "Tony",
      lastName: "Stark",
      dateOfBirth: "05/29/1970",
      city: "New York",
      countries: "United States of America",
    },
    {
      firstName: "Steve",
      lastName: "Rogers",
      dateOfBirth: "07/04/1920",
      city: "New York",
      countries: "United States of America",
    },
    {
      firstName: "Robert Bruce",
      lastName: "Banner",
      dateOfBirth: "12/18/1969",
      city: "New York",
      countries: "United States of America",
    },
  ];

  const title = Object.keys(data[0]);

  return (
    <Table
      dataTable={data}
      dataTitle={title}
      tableTitle={"table-caption"}
      rowsPerTable={10}
      range={3}
      selectEntries
      backgroundThemePrimary={"#2b2b2b"}
      contentThemePrimary={"#d4d4d4"}
      backgroundThemeSecondary={"#d4d4d4"}
      contentThemeSecondary={"#2b2b2b"}
    />
  );
};

export default render;

Component props

  • dataTable : [Array of Object]

    This prop is used for all data of the table

  • dataTitle : [Array of String]

    This prop is used for the key and the the header of the table ( !Warning : the key must be the same of the key of the data defined in dataTable )

  • tableTitle : [String]

    This prop is used for define the title of the table (is not required)

  • rowsPerTable: [Number]

    This prop is used to define the rows for each page of the pagination

  • backgroundThemePrimary: [String]

    This prop is used to define the primary background of the table

  • contentThemePrimary: [String]

    This prop is used to define the primary content of the table

  • backgroundThemeSecondary: [String]

    This prop is used to define the secondary background of the table

  • contentThemeSecondary: [String]

    This prop is used to define the secondary content of the table

  • range: [Number]

    This prop is used to define the number of each sibling pagination we can see

  • selectEntries : [Boolean]

    This prop is used to declare if we want to add a select list for the entries of each pagination

Dependencies