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

nillys-react-table-library

v1.1.3

Published

**Nillys React Table Library (NRTL)** is a customizable and easy-to-use React component for displaying data tables with features like sorting, pagination, and search. This library allows you to customize the table's styles and behavior to suit your needs.

Downloads

10

Readme

Nillys React Table Library (NRTL)

Nillys React Table Library (NRTL) is a customizable and easy-to-use React component for displaying data tables with features like sorting, pagination, and search. This library allows you to customize the table's styles and behavior to suit your needs.

demo

Installation

To install this package, use npm:

npm install nillys-react-table-library

Usage

Here is a basic example of how to use the NRTL component in your React project:

import React from 'react'
import { NRTL } from 'nillys-react-table-library'
import "nillys-react-table-library/style";

const App = () => {
  const datas = {
    tableHead: ['Name', 'Age', 'Profession'],
    tableBody: [
      ['Alice', '30', 'Engineer'],
      ['Bob', '25', 'Designer'],
      ['Charlie', '35', 'Manager'],
    ],
  }

  return (
    <div>
      <h1>Customizable Table</h1>
      <NRTL
        datas={datas}
        headerBackgroundColor="lightblue"
        rowHoverColor="lightgray"
        showPagination={true}
        enableColumnSorting={true}
      />
    </div>
  )
}

export default App

Props

The NRTL component comes with a wide range of customization options. Below is a list of available props with their default values.

| Prop | Type | Description | Default | |--------------------------------|--------------------|--------------------------------------------------------------------------------------------|----------------------------------------------| | datas | INRTL | The data for the table, containing tableHead (column titles) and tableBody (row data). | Required | | headerBackgroundColor | string | Background color of the table header. | linear-gradient(to left, #d5e065, #a8c24e) | | headerHoverBackgroundColor | string | Background color of the table header on hover. | #a8c24e | | textColor | string | Color of the text inside the table. | #36395a | | rowColor | string | Background color of the table rows. | #ffffff | | rowHoverColor | string | Background color of the rows when hovered. | #36395a | | hoverTextColor | string | Text color in the rows when hovered. | #ffffff | | disabledButtonColor | string | Color of disabled buttons (pagination buttons, etc.). | #dcdcdc | | columnSortingColor | string | Color of the sorting indicator chevron. | #dcdcdc | | columnSortingFullFilledColor | string | Color of the chevron when a column is sorted. | #36395a | | showSearchBar | boolean | Displays or hides the search bar above the table. | false | | showItemsPerPageSelector | boolean | Displays or hides the items-per-page selector. | false | | showPagination | boolean | Displays or hides pagination controls. | false | | showPreviousNextButtons | boolean | Displays or hides the previous/next buttons in pagination. | false | | enableColumnSorting | boolean | Enables or disables sorting by column. | false | | itemsPerPageOptions | number[] | Array of options for the number of items per page. | [25, 50, 100] | | language | En Fr string | Language of table elements. | En |

Data Structure (INRTL)

The datas prop expects an object of type INRTL, which contains the table header and body data.

interface INRTL {
  tableHead: string[] // The column headers
  tableBody: string[][] // The table rows as arrays of strings
}

Example:

{
  "tableHead": ["Name", "Age", "Profession"],
  "tableBody": [
    ["Alice", "30", "Engineer"],
    ["Bob", "25", "Designer"],
    ["Charlie", "35", "Manager"]
  ]
}

Advanced Example

Here's an example that showcases more customization options:

import React from 'react'
import { NRTL } from 'nillys-react-table-library'
import "nillys-react-table-library/style";

const App = () => {
  const datas = {
    tableHead: ['Name', 'Age', 'Profession'],
    tableBody: [
      ['Alice', '30', 'Engineer'],
      ['Bob', '25', 'Designer'],
      ['Charlie', '35', 'Manager'],
    ],
  }

  return (
    <div>
      <h1>Advanced Table Customization</h1>
      <NRTL
        datas={datas}
        headerBackgroundColor="lightblue"
        headerHoverBackgroundColor="darkblue"
        textColor="black"
        rowColor="white"
        rowHoverColor="lightgray"
        columnSortingColor="gray"
        columnSortingFullFilledColor="blue"
        showSearchBar={true}
        showPagination={true}
        enableColumnSorting={true}
        itemsPerPageOptions={[5, 10, 25]}
        language={'Fr'}
      />
    </div>
  )
}

export default App

License

This project is licensed under the NRTL-NonCommercial license. You are free to use, modify, and distribute this project for internal, non-commercial purposes. Please read the LICENSE.md file for more details.