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

scdatagrid

v1.0.20

Published

This package used to simple data grid package with global search filter

Downloads

26

Readme

SCDataGrid Table Library

SCDataGrid React Data Table Component is use to simple datagrid table library.👋

Key Features

  • Declarative configuration

  • Build-In and configuration

    • Sorting
    • Global Search
    • Pagination
    • Configure custom styles

Requirements

SCDataGrid Table Component requires the following be installed in your project:

  • React ^18.3.1
  • React-Dom ^18.3.1

Installation

npm install scdatagrid

Or

yarn add scdatagrid

Usage

Prior to using this package, familiarise yourself with the headerData structure. To generate your own headerData object and table data as columData object properties, refer to the code block below.

const HeaderData = [{
	Header: 'title', accessor: 'name', sort: true 
}];
  • Header - The column header title is set using the header.
  • accessor - The right property to set the column data is located using the accessor.
  • sort - Sort is used to establish a sort according to column data.

Example

const HeaderData = [
          { Header: 'Name', accessor: 'name', sort: true },
          { Header: 'User Name', accessor: 'username', sort: true },
          { Header: 'Email', accessor: 'email' },
          { Header: 'Mobile Number', accessor: 'phone' },
          { Header: 'Company', accessor: 'company.name' },
          { Header: 'City', accessor: 'address.city' },
          { Header: 'Zip Code', accessor: 'address.zipcode' },
     ];

Example columData from your reference. data.json

[
  {
    "id": 1,
    "name": "Leanne Graham",
    "username": "Bret",
    "email": "[email protected]",
    "address": {
      "street": "Kulas Light",
      "suite": "Apt. 556",
      "city": "Gwenborough",
      "zipcode": "92998-3874",
      "geo": {
        "lat": "-37.3159",
        "lng": "81.1496"
      }
    },
    "phone": "1-770-736-8031 x56442",
    "website": "hildegard.org",
    "company": {
      "name": "Romaguera-Crona",
      "catchPhrase": "Multi-layered client-server neural-net",
      "bs": "harness real-time e-markets"
    }
  },
  {
    "id": 2,
    "name": "Ervin Howell",
    "username": "Antonette",
    "email": "[email protected]",
    "address": {
      "street": "Victor Plains",
      "suite": "Suite 879",
      "city": "Wisokyburgh",
      "zipcode": "90566-7771",
      "geo": {
        "lat": "-43.9509",
        "lng": "-34.4618"
      }
    },
    "phone": "010-692-6593 x09125",
    "website": "anastasia.net",
    "company": {
      "name": "Deckow-Crist",
      "catchPhrase": "Proactive didactic contingency",
      "bs": "synergize scalable supply-chains"
    }
  }
]

Now, you can import use this import { DataGrid } from "scdatagrid" from scdatagrid package, where you want.

import { DataGrid } from "scdatagrid";
import data from "./data.json";

const App: React.FC = () => {

	return <DataGrid headerData={headerData} columData={data} />

}

export default App;

Props

  • headerData - Object[] The data table header is configured using headerData.
  • columData - Object[] The data is passed to this package using columData.
  • globalSearch - boolean To display or conceal the search bar, use globalSearch.
  • numOfRows - number The number of rows displayed in the table is indicated by numofRows.
  • tableTitleName - string Table title text is passed through the table title.
  • tableTitle - boolean To display or conceal the search bar, use table title.
  • pagination - boolean To display or conceal the search bar, use pagination.
  • loading - boolean Before the table is rendered, loading is used to execute the loader.
  • showMenu - boolean To display or conceal the search bar, use showMenu.
  • style - Object style is used to set a unique style for a certain component.

Style Props

  • tableOutterStyle - With the use of these CSS properties, the table's outer container can be changed.
  • tablestyle - This prop is used to apply CSS properties to the table customisation.
  • tableHeadStyle - This prop is used to apply CSS properties to the table header row customisation.
  • tableHeadItemStyle - This prop is used to apply CSS properties to the table header row item customisation.
  • tableTitle - This prop is used to apply CSS properties to the table title customisation.
  • tableBodyStyle - This prop is used to apply CSS properties to the table body row container customisation.
  • tableBodyItemStyle - This prop is used to apply CSS properties to the table body row item container customisation.
  • searchInputStyle - This prop is used to apply CSS properties to the search bar customisation.
  • paginationButtonStyle - This prop is used to apply CSS properties to the pagination button customisation.

Creator

Ashokkumar A