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

@mmmmzxe/table-kit

v1.0.4

Published

A customizable React table kit with TailwindCSS and i18n support.

Downloads

42

Readme

table-kit

A customizable and easy-to-use React component library for building tables with advanced features like pagination and controls.

Features

  • Simple integration with React projects
  • Pagination support
  • Table controls for sorting and filtering
  • Modular and extensible components

Packages Used

  • react & react-dom: For building interactive user interfaces.
  • vite: Fast, modern build and development tool for React projects.
  • @vitejs/plugin-react: Enables JSX and React features in Vite.
  • typescript: Adds type safety to your codebase.
  • tailwindcss: Utility-first CSS framework for rapid UI development.
  • postcss: CSS processing tool (required for Tailwind).
  • @tailwindcss/postcss: Tailwind plugin for PostCSS integration.
  • autoprefixer: Automatically adds CSS vendor prefixes for cross-browser support.

Installation

npm install table-kit

Usage

1. Import the Components

import { StandardTable, Pagination, TableControls } from 'table-kit';

2. Full Example: Complete Table with All Features

Below is a complete example of how to use StandardTable with all features (pagination, filtering, date picker, and per-page control):

import React from 'react';
import { StandardTable } from 'table-kit';

const columns = [
  { key: 'name', label: 'Name' },
  { key: 'age', label: 'Age' },
  { key: 'city', label: 'City' },
  { key: 'date', label: 'Date' },
];
const allData = [
  { name: 'Ali', age: 25, city: 'Cairo', date: '2025-07-15' },
  { name: 'Sara', age: 30, city: 'Alexandria', date: '2025-07-16' },
  { name: 'Omar', age: 22, city: 'Giza', date: '2025-07-15' },
  { name: 'Mona', age: 28, city: 'Mansoura', date: '2025-07-14' },
  { name: 'Youssef', age: 35, city: 'Aswan', date: '2025-07-16' },
  { name: 'Laila', age: 27, city: 'Tanta', date: '2025-07-13' },
  { name: 'Hassan', age: 31, city: 'Suez', date: '2025-07-15' },
  { name: 'Nour', age: 24, city: 'Zagazig', date: '2025-07-16' },
  { name: 'Khaled', age: 29, city: 'Fayoum', date: '2025-07-14' },
  { name: 'Dina', age: 26, city: 'Ismailia', date: '2025-07-13' },
  { name: 'Samir', age: 33, city: 'Luxor', date: '2025-06-15' },
  { name: 'Rania', age: 23, city: 'Port Said', date: '2025-08-16' },
];

function App() {
  const [page, setPage] = React.useState(1);
  const [perPage, setPerPage] = React.useState(5);
  const [dateFilter, setDateFilter] = React.useState<string | undefined>(undefined); // Specific date
  const [rangeFilter, setRangeFilter] = React.useState('All'); // Time filter

  // Filtering logic
  let filteredData = allData;
  if (dateFilter) {
    filteredData = allData.filter(row => row.date === dateFilter);
  } else if (["This Month", "Last Month", "This Year"].includes(rangeFilter)) {
    // You can use a helper like getDateRangeFromFilter here
    const { from, to } = getDateRangeFromFilter(rangeFilter);
    if (from && to) {
      filteredData = allData.filter(row => row.date >= from && row.date <= to);
    }
  }

  const total = filteredData.length;
  const fromIdx = (page - 1) * perPage;
  const toIdx = fromIdx + perPage;
  const data = filteredData.slice(fromIdx, toIdx);

  return (
    <div className="p-8">
      <StandardTable
        columns={columns}
        data={data}
        total={total}
        page={page}
        perPage={perPage}
        filter={rangeFilter}
        onPageChange={setPage}
        onPerPageChange={(val) => { setPerPage(val); setPage(1); }}
        onFilterChange={(val) => {
          setRangeFilter(val);
          setDateFilter(undefined);
          setPage(1);
        }}
        date={dateFilter}
        onDateChange={(val) => {
          const onlyDate = val ? val.slice(0, 10) : undefined;
          setDateFilter(onlyDate);
          setRangeFilter('All');
          setPage(1);
        }}
        filterOptions={["All", "This Month", "Last Month", "This Year"]}
      />
    </div>
  );
}

Explanation:

  • The table supports both time range filtering ("This Month", etc.) and specific date filtering (via date picker).
  • Changing the time filter resets the date filter, and vice versa.
  • Pagination and per-page controls are fully functional.

Usage (Other Components)

3. Example: Using Pagination Directly

import { Pagination } from 'table-kit';

<Pagination
  currentPage={1}
  lastPage={5}
  total={50}
  from={1}
  to={10}
  onPageChange={(page) => console.log(page)}
/>

4. Example: Using TableControls Directly

import { TableControls } from 'table-kit';

<TableControls
  perPage={10}
  onPerPageChange={(val) => console.log(val)}
  filter={"All"}
  onFilterChange={(val) => console.log(val)}
  filterOptions={["All", "This Month", "Last Month", "This Year"]}
/>

Components Details

1. StandardTable

  • Description: A dynamic table component supporting filtering, pagination, per-page control, and search.
  • Main Props:
    • columns: Array of column definitions (key and label).
    • data: The data to display.
    • total: Total number of items.
    • page, perPage: Current page and items per page.
    • filter, onFilterChange: Filtering by time range or value.
    • onPageChange, onPerPageChange: Pagination controls.
    • filterOptions: Time filter options.
  • Extra Features:
    • Displays "No data found" automatically when empty.
    • Fully styled with TailwindCSS.

2. Pagination

  • Description: Pagination control component (next/previous) with page numbers.
  • Props:
    • currentPage, lastPage, total, from, to, onPageChange.
  • Usage: Can be used standalone or within StandardTable.

3. TableControls

  • Description: Controls for filters, per-page selection, search, and date filtering.
  • Props:
    • perPage, onPerPageChange: Items per page control.
    • filter, onFilterChange, filterOptions: Time filters.
    • date, onDateChange: Filter by specific date.
    • searchTerm, onSearchChange: Search (optional).

File Structure

table-kit/
├── package.json           # Project metadata and dependencies
├── README.md              # Documentation and usage instructions
├── vite.config.ts         # Vite build configuration
├── tsconfig.json          # TypeScript configuration
├── postcss.config.js      # PostCSS (and Tailwind) configuration
├── index.html             # App entry HTML (for Vite)
└── src/
    ├── index.ts           # Library entry point (exports components)
    └── components/
        ├── StandardTable.tsx   # Main table component
        ├── Pagination.tsx      # Pagination component
        ├── TableControls.tsx   # Table controls (filters, search, per-page)
        └── LoadingSpinner.tsx  # Loading spinner utility
    └── utils/
        └── helpers.ts          # Helper functions (date, formatting, etc)

Contributing

Contributions are welcome! Please open issues or submit pull requests for any features, bug fixes, or suggestions.

License