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

@manikantsharma/react-datatable

v1.0.4

Published

A premium, lightweight datatable for React built with @mui/material. No heavy dependencies.

Readme

@manikantsharma/react-datatable

NPM npm npm NPM NPM Unpacked Size

A premium, lightweight, and highly customizable Datatable component for React built with @mui/material. Features sorting, pagination, column visibility persistence, and polished loading states.

Features

  • Zero Heavy Dependencies: Only depends on @mui/material and react. No external icon sets.
  • Premium UI: Modern design with subtle micro-interactions, smooth transitions, and glassmorphism elements.
  • Column Management: Built-in menu to show/hide columns with persistent state.
  • Persistence: Automatically saves column visibility preferences to localStorage using a tableId.
  • Smart Sorting: Built-in sorting supporting nested object properties via dot notation.
  • Pagination: Seamless integration with MUI Pagination, supporting both client and server modes.
  • Loading States: Professional skeleton loading for a better user experience.
  • Permission Support: Built-in handling for access-denied or restricted data states.
  • TypeScript: Full type safety out of the box with generic data support.

Installation

npm install @manikantsharma/react-datatable
# or
yarn add @manikantsharma/react-datatable
# or
pnpm add @manikantsharma/react-datatable

Peer Dependencies

Make sure you have these peer dependencies installed:

npm install react react-dom @mui/material @emotion/react @emotion/styled

Quick Start

import { DataTable, type TableColumn } from "@manikantsharma/react-datatable";
import React from "react";

interface User {
  id: number;
  name: string;
  role: string;
  status: "Active" | "Inactive";
}

const columns: TableColumn<User>[] = [
  { id: "id", label: "ID", numeric: true, sortable: true },
  { id: "name", label: "Name", sortable: true },
  { id: "role", label: "Role" },
  {
    id: "status",
    label: "Status",
    render: (value) => (
      <span
        style={{
          color: value === "Active" ? "#10b981" : "#ef4444",
          fontWeight: 600,
        }}
      >
        {value}
      </span>
    ),
  },
];

const data: User[] = [
  { id: 1, name: "John Doe", role: "Admin", status: "Active" },
  { id: 2, name: "Jane Smith", role: "User", status: "Inactive" },
];

export default function App() {
  return (
    <DataTable
      data={data}
      columns={columns}
      tableId="user_management_table"
      pagination={true}
      filterColunm={true}
    />
  );
}

API Reference

DataTable Props

| Property | Type | Default | Description | | :------------- | :-------------------------------- | :------ | :------------------------------------------------------ | | data | T[] | - | Array of data objects to display. | | columns | TableColumn<T>[] | - | Configuration for table columns. | | tableId | string | - | Unique ID to persist column visibility in localStorage. | | loading | boolean | false | Shows skeleton loader when true. | | pagination | boolean | true | Enables pagination controls. | | sortable | boolean | true | Enables sorting functionality globally. | | totalCount | number | 0 | Total records for server-side pagination. | | page | number | 0 | Current page number (controlled). | | rowsPerPage | number | 6 | Number of rows per page. | | onPageChange | (page: number) => void | - | Callback when page changes. | | onRowClick | (row: T, index: number) => void | - | Callback when a row is clicked. | | compact | boolean | false | Reduces padding for a dense view. | | filterColunm | boolean | true | Shows the column management menu. | | isPermission | boolean | true | If false, displays "Access Denied" UI. | | stickyHeader | boolean | false | Enable sticky table header. |

Column Configuration

interface TableColumn<T> {
  id: string; // Supports dot notation: 'user.profile.name'
  label: string;
  numeric?: boolean;
  sortable?: boolean;
  isVisible?: boolean;
  hideable?: boolean; // Can user toggle visibility
  render?: (value: any, row: T, index: number) => React.ReactNode;
  styled?: React.CSSProperties;
  width?: string | number;
}

Advanced Features

Persistence

By providing a tableId, the component will automatically remember which columns the user has hidden or shown. This is saved in the browser's localStorage and persists across sessions.

Permission Handling

Easily manage restricted data views using the isPermission and noAccessMessage props.

<DataTable
  data={data}
  columns={columns}
  isPermission={userHasAccess}
  noAccessMessage="Contact admin for access to this data."
/>

Browser Support

| Chrome | Firefox | Safari | Opera | Edge | | :------------------------------------------------------------------------------------------------ | :--------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------ | :--------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------ | | Latest | Latest | Latest | Latest | Latest |

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

MIT - Mani Kant Sharma

Author

Mani Kant Sharma

Email Instagram GitHub

Changelog

v1.0.0

  • Initial release
  • Modularized architecture
  • LocalStorage persistence for column visibility
  • Professional JSDoc documentation
  • Zero-dependency icons and assets