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

sila-ck-table-mui-rtk-query-npm

v1.0.21

Published

table mui with flexible using RTK

Downloads

23

Readme

sila-ck-table.package

License

Overview

sila-ck-table.package is a flexible, highly customizable table component built with Material-UI (MUI) and powered by Redux Toolkit (RTK) Query.
It offers advanced features like pagination, sorting, filtering, and seamless integration with backend data fetching using RTK Query.

This package is designed to simplify complex table handling in React applications, particularly when working with paginated backend APIs.


Install Package

https://www.npmjs.com/package/sila-ck-table-mui-rtk-query-npm


Features

  • Fully customizable table columns and cell rendering
  • Pagination support with flexible footer types
  • Sorting and filtering capabilities
  • Integration with Redux Toolkit Query for backend data fetching
  • Responsive design using MUI components
  • Selection support (single/multiple rows)
  • Handles loading, error, and empty states gracefully

Installation

Install via npm or yarn:

npm install sila-ck-table.package
# or
yarn add sila-ck-table.package


Usage Example
Here is an example of how to use the package with React, MUI, and RTK Query:



import React from 'react';
import { useTableCustom } from './hooks/useTableCustom';
import { EnumTableFooterType } from './components/types';
import { handleProcessPassingData } from './utils/handleProcessPassingData';
import { TableCustom } from './components/TableCustom';
import { Stack, Typography } from '@mui/material';

// Sample backend response data structure
const dataSample = {
  page: 1,
  pageSize: 10,
  total: 10,
  hasNext: false,
  totalPages: 1,
  contents: [
    { id: 1, name: "sila1" },
    { id: 2, name: "sila2" },
    { id: 3, name: "sila3" },
    { id: 4, name: "sila4" },
    { id: 5, name: "sila5" },
    { id: 6, name: "sila6" },
    { id: 7, name: "sila7" },
    { id: 8, name: "sila8" },
    { id: 9, name: "sila9" },
    { id: 10, name: "sila10" },
  ],
};

export type CollectionDataUserDashboard = {
  id: string | number;
  name: string;
};

const CTableExample = <CO extends CollectionDataUserDashboard>() => {
  const {
    setVisibleRows,
    visibleRows,
    selected,
    setSelected,
    handleSelectAllClick,
    filter,
    setFilter,
    tableFooterType,
  } = useTableCustom<CO>(EnumTableFooterType.pagination);

  // Simulated RTK Query response
  const { currentData } = { currentData: dataSample };

  const handleSetVisibleRows = async (propData?: typeof dataSample) => {
    if (propData) {
      const { contents, page } = propData;
      const newMap: CO[] = contents.map(item => item as CO);

      handleProcessPassingData<CO>({
        tableFooterType,
        visibleRows,
        setVisibleRows,
        newMap,
        page,
        setSelected,
      });
    }
  };

  React.useEffect(() => {
    handleSetVisibleRows(currentData).then(() => {});
  }, [currentData]);

  return (
    <TableCustom<any, CO>
      tableContainerSx={{
        height: "100%",
        width: "100%",
      }}
      setVisibleRows={setVisibleRows}
      currentData={currentData}
      setFilter={setFilter}
      filter={filter}
      actionReq={{ error: false, isLoading: false, isError: false, isFetching: false }}
      tableFooterType={tableFooterType}
      visibleRows={visibleRows}
      headCells={[
        {
          id: 'id',
          disableSort: false,
          label: "ID",
          tableCellProps: {
            align: "left",
            padding: "none",
            width: "500px",
            sx: { paddingLeft: "30px" },
          },
          tableSortLabelProps: {},
          render: data => (
            <Stack direction={"row"} alignItems={"center"} gap={"15px"} pl={"30px"}>
              <Typography>#{data.id}</Typography>
            </Stack>
          ),
        },
        {
          id: 'name',
          disableSort: false,
          label: "Name",
          tableCellProps: {
            align: "left",
            padding: "none",
            width: "500px",
            sx: { paddingLeft: "30px" },
          },
          tableSortLabelProps: {},
          render: data => (
            <Stack direction={"row"} alignItems={"center"} gap={"15px"} pl={"30px"}>
              <Typography>{data.name}</Typography>
            </Stack>
          ),
        },
      ]}
      selected={selected}
      handleSelectAllClick={handleSelectAllClick}
      hasNext={currentData?.hasNext ?? false}
      emptyData={<Typography>No Result</Typography>}
    />
  );
};

export default CTableExample;


| Prop                   | Type       | Description                          | Default    |
| ---------------------- | ---------- | ------------------------------------ | ---------- |
| `data`                 | `Array`    | Data array to display in the table   | `[]`       |
| `columns`              | `Array`    | Table column definitions and options | `[]`       |
| `sortable`             | `boolean`  | Enable or disable column sorting     | `true`     |
| `filterable`           | `boolean`  | Enable or disable filtering          | `false`    |
| `pagination`           | `boolean`  | Enable or disable pagination         | `true`     |
| `selected`             | `Array`    | Selected row keys                    | `[]`       |
| `setSelected`          | `Function` | Function to update selected rows     | `() => {}` |
| `handleSelectAllClick` | `Function` | Handler for select all checkbox      | `() => {}` |