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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@mahdialikhani/react-datatable

v1.1.24

Published

Mahdi alikhani datatable component for handle lists

Downloads

8

Readme

ReactJs dataTable package

DataTable is a ReactJs component that makes it easier to work with lists. We are working to add new features to this component We would be happy if you could help us.

We are In this component used the following packages, and you can use the guide of these packages to make the best use of it.

  • react-js-pagination

Installation

Install @mahdialikhani/react-datatable with npm:

npm i @mahdialikhani/react-datatable

###Usage

This component is very easy to use.

#####Example:

import React from 'react';
import DataTable from '@mahdialikhani/react-datatable';

function Users() {

    let data = {
        columns: [
            {label: 'row', name: 'id'},
            {label: 'Name', name: 'name'},
            {label: 'LastName', name: 'last_name'},
            {label: 'Email', name: 'email'},
            {label: 'Actions', name: 'actions'},
        ],
        rows: [
            {
                id: 1,
                name: 'Connor Donnelly',
                last_name : 'Johns',
                email: '[email protected]'
            }
        ]
    };

    let styles = {
        countSelectorText: ['show'],
        searchText: ['search'],
    };

    const [state, setState] = useState({data: data});

    const buttons = (user) => {
        return (
            <div key={Math.random()}>
                <button type="button" className="btn btn-warning btn-sm">
                    Edit
                </button>
                <button type="button" className="btn btn-danger btn-sm">
                    Delete
                </button>
            </div>
        );
    };

    return (
        <div className="container list-div">
            <DataTable data={state.data} buttons={buttons} styles={styles}/>
        </div>
    );
}

export default Users;

I must say that if you do not want to work for the appearance of the lists yourself, you can create a beautiful appearance by calling the file below. '@mahdialikhani/react-datatable/assets/Styles/styles.scss'

As you can see in the picture below, you can view your list of information on the page by calling the DataTable component

#####Example result: Example

Yes, you can use this component as easily as you can see.

Params for Personalization

You can use the following parameters to customize this component.

1- countSelectorText: ['show'] : You can also add another text to this array, which will be displayed after the count selector.

For example:
    let styles = {
        countSelectorText: ['show', 'entries']
    };

2- searchText: ['search'] : You can add another text to this array to display it in the list search input.

For example:
    let styles = {
        countSelectorText: ['show', 'entries'],
        searchText: ['search', 'search...']
    };

3- ordering : This parameter accepts an array as a value, which is used to move items above the list (the same as the number selector and search input).
If you want the number selector to be on the right and the search input to be on the left, you need to arrange the two numbers as the first and second items and the first number is larger than the second.

For example:
    let styles = {
        countSelectorText: ['show', 'entries'],
        searchText: ['search', 'search...'],
        ordering: [2, 1],
    };
Or
    let styles = {
        countSelectorText: ['show', 'entries'],
        searchText: ['search', 'search...'],
        ordering: [1, 2], /*Default*/
    };

4- paginateClass : This parameter can be a Css or Bootstrap class that can move the list of your page numbers below the list to the left or right.

For example:
    let styles = {
        countSelectorText: ['show', 'entries'],
        searchText: ['search', 'search...'],
        ordering: [1, 2],
        paginateClass: 'pull-left',
    };
Or
    let styles = {
        countSelectorText: ['show', 'entries'],
        searchText: ['search', 'search...'],
        ordering: [1, 2],
        paginateClass: 'pull-right',
    };

5- pagination : This parameter is an array that accepts an object as the first item. In this item, you can customize the specifications of the buttons previous and next pages.

You can also change the status of the quick transfer buttons to the first or last pages.

For example:
    let styles = {
        countSelectorText: ['show', 'entries'],
        searchText: ['search', 'search...'],
        ordering: [1, 2],
        paginateClass: 'pull-left',
        pagination: [
            {
                prevPageText: '<',
                nextPageText: '>',
                hideFirstLastPages: false
            }
        ]
    };
Or
    let styles = {
        countSelectorText: ['show', 'entries'],
        searchText: ['search', 'search...'],
        ordering: [1, 2],
        paginateClass: 'pull-left',
        pagination: [
            {
                prevPageText: 'prev',
                nextPageText: 'Next',
                hideFirstLastPages: true
            }
        ]
    };