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

@abdasis/datatable

v1.0.1

Published

A powerful and configurable DataTable component with TailwindCSS and shadcn/ui for Next.js applications

Readme

@abdasis/datatable

A powerful, configurable, and modern DataTable component for React/Next.js applications with TailwindCSS and shadcn/ui support.

✨ Features

  • 🚀 Client & Server-side rendering support
  • 🎨 Customizable UI with your own shadcn/ui components
  • 🔧 Advanced configuration panel with persistent settings
  • 📱 Responsive design with mobile-friendly interface
  • 🔍 Global search & column filtering
  • 📊 Sorting, pagination & row selection
  • 💾 localStorage persistence for table configurations
  • 📤 Export functionality support
  • 🎯 TypeScript first with full type safety
  • Performance optimized with memo and callbacks

📦 Installation

npm install @abdasis/datatable
# or
yarn add @abdasis/datatable
# or
pnpm add @abdasis/datatable

Peer Dependencies

Make sure you have these dependencies installed:

npm install react react-dom @tanstack/react-table @tanstack/match-sorter-utils lucide-react tailwindcss class-variance-authority clsx tailwind-merge

🚀 Quick Start

1. Prepare Your UI Components

The package requires you to provide your own UI components (typically from shadcn/ui):

import { Button } from "@/components/ui/button";
import { Input } from "@/components/ui/input";
import {
  Table,
  TableBody,
  TableCell,
  TableHead,
  TableHeader,
  TableRow,
} from "@/components/ui/table";
// ... import other UI components

const uiComponents = {
  Button,
  Input,
  Table,
  TableBody,
  TableCell,
  TableHead,
  TableHeader,
  TableRow,
  // ... other components
};

2. Basic Usage

import { DataTable, type ColumnDef } from "@abdasis/datatable";

interface User {
  id: number;
  name: string;
  email: string;
  status: "active" | "inactive";
}

const columns: ColumnDef<User, any>[] = [
  {
    id: "name",
    header: "Name",
    accessorKey: "name",
  },
  {
    id: "email",
    header: "Email",
    accessorKey: "email",
  },
  {
    id: "status",
    header: "Status",
    accessorKey: "status",
  },
];

const data: User[] = [
  { id: 1, name: "John Doe", email: "[email protected]", status: "active" },
  { id: 2, name: "Jane Smith", email: "[email protected]", status: "inactive" },
];

function MyTable() {
  return (
    <DataTable
      columns={columns}
      data={data}
      uiComponents={uiComponents}
      enableConfigPanel
      tableId="users-table"
    />
  );
}

📋 Required UI Components

You need to provide these components from your UI library (e.g., shadcn/ui):

interface UIComponents {
  // Basic components
  Button: React.ComponentType<any>;
  Input: React.ComponentType<any>;

  // Table components
  Table: React.ComponentType<any>;
  TableBody: React.ComponentType<any>;
  TableCell: React.ComponentType<any>;
  TableHead: React.ComponentType<any>;
  TableHeader: React.ComponentType<any>;
  TableRow: React.ComponentType<any>;

  // Form components
  Checkbox: React.ComponentType<any>;
  Select: React.ComponentType<any>;
  SelectContent: React.ComponentType<any>;
  SelectItem: React.ComponentType<any>;
  SelectTrigger: React.ComponentType<any>;
  SelectValue: React.ComponentType<any>;

  // Dropdown components
  DropdownMenu: React.ComponentType<any>;
  DropdownMenuCheckboxItem: React.ComponentType<any>;
  DropdownMenuContent: React.ComponentType<any>;
  DropdownMenuItem: React.ComponentType<any>;
  DropdownMenuLabel: React.ComponentType<any>;
  DropdownMenuSeparator: React.ComponentType<any>;
  DropdownMenuTrigger: React.ComponentType<any>;

  // Other components
  Badge: React.ComponentType<any>;
}

For TableConfigPanel (additional components):

interface TableConfigUIComponents {
  // All UIComponents above, plus:
  Switch: React.ComponentType<any>;
  Label: React.ComponentType<any>;
  Popover: React.ComponentType<any>;
  PopoverContent: React.ComponentType<any>;
  PopoverTrigger: React.ComponentType<any>;
  Collapsible: React.ComponentType<any>;
  CollapsibleContent: React.ComponentType<any>;
  CollapsibleTrigger: React.ComponentType<any>;
  Separator: React.ComponentType<any>;
}

🎛️ Configuration Panel

Enable the advanced configuration panel for your users:

<DataTable
  columns={columns}
  data={data}
  uiComponents={uiComponents}
  enableConfigPanel={true}
  tableId="my-unique-table"
  onConfigChange={(config) => {
    console.log("Configuration changed:", config);
  }}
/>

The configuration panel provides:

  • View mode toggle (List/Board)
  • Column visibility controls
  • Sorting and filtering options
  • Persistent settings via localStorage

🖥️ Server-Side Rendering

For server-side data fetching and pagination:

<DataTable
  columns={columns}
  data={data}
  renderMode="server"
  serverConfig={{
    totalRows: 1000,
    pageCount: 50,
    loading: isLoading,
    onSortingChange: (sorting) => {
      // Handle server-side sorting
    },
    onColumnFiltersChange: (filters) => {
      // Handle server-side filtering
    },
    onPaginationChange: (pagination) => {
      // Handle server-side pagination
    },
    onGlobalFilterChange: (globalFilter) => {
      // Handle server-side global search
    },
  }}
  uiComponents={uiComponents}
/>

🎨 Customization Examples

With Row Actions

<DataTable
  columns={columns}
  data={data}
  uiComponents={uiComponents}
  rowActions={[
    {
      label: "Edit",
      onClick: (row) => console.log("Edit", row),
      icon: <Edit className="h-4 w-4" />,
    },
    {
      label: "Delete",
      onClick: (row) => console.log("Delete", row),
      icon: <Trash className="h-4 w-4" />,
      variant: "destructive",
    },
  ]}
/>

With Filterable Columns

<DataTable
  columns={columns}
  data={data}
  uiComponents={uiComponents}
  filterableColumns={[
    { id: "status", title: "Status" },
    { id: "category", title: "Category" },
  ]}
/>

With Row Selection

<DataTable
  columns={columns}
  data={data}
  uiComponents={uiComponents}
  enableRowSelection={true}
  onRowSelectionChange={(selectedRows) => {
    console.log("Selected rows:", selectedRows);
  }}
/>

📝 API Reference

DataTable Props

| Prop | Type | Default | Description | | ------------------------ | ------------------------------------------------------------------------------- | ----------- | ------------------------------------------ | | columns | ColumnDef<TData, TValue>[] | - | Required. Column definitions | | data | TData[] | - | Required. Table data | | uiComponents | UIComponents | - | Required. UI component implementations | | renderMode | "client" \| "server" | "client" | Rendering mode | | serverConfig | DataTableServerConfig | - | Server-side configuration | | enableGlobalFilter | boolean | true | Enable global search | | enableColumnFilters | boolean | true | Enable column filters | | enableSorting | boolean | true | Enable sorting | | enablePagination | boolean | true | Enable pagination | | enableRowSelection | boolean | false | Enable row selection | | enableColumnVisibility | boolean | true | Enable column visibility toggle | | enableConfigPanel | boolean | false | Enable advanced config panel | | initialPageSize | number | 10 | Initial page size | | tableId | string | "default" | Unique identifier for localStorage | | filterableColumns | Array<{id: string, title: string}> | [] | Columns that can be filtered | | rowActions | Array<{label: string, onClick: Function, icon?: ReactNode, variant?: string}> | [] | Row action buttons | | onRowSelectionChange | (selectedRows: TData[]) => void | - | Row selection callback | | onExport | () => void | - | Export button callback | | onConfigChange | (config: TableConfigState) => void | - | Configuration change callback |

🔧 Development

Setup

git clone <repository-url>
cd quickpay-datatable-npm
npm install

Build

npm run build

Development

npm run dev

📄 License

MIT

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

📞 Support

If you have any questions or issues, please open an issue on our GitHub repository.


Built with ❤️ by the QuickPay Team