Getting Started
Start using @manikantsharma/react-datatable in your project
About @manikantsharma/react-datatable
A premium, lightweight, and highly customizable Datatable component for React built with @mui/material. It features sorting, pagination, column visibility persistence, and polished loading states.
Installation
Install the package using your preferred package manager:
npm
1npm install @manikantsharma/react-datatableyarn
1yarn add @manikantsharma/react-datatablePeer Dependencies
Make sure you have these peer dependencies installed:
1npm install react react-dom @mui/material @emotion/react @emotion/styledQuick Start
Import the DataTable component and start using it immediately:
1import { DataTable, type TableColumn } from "@manikantsharma/react-datatable";
2import React from "react";
3
4interface User {
5 id: number;
6 name: string;
7 role: string;
8 status: "Active" | "Inactive";
9}
10
11const columns: TableColumn<User>[] = [
12 { id: "id", label: "ID", numeric: true, sortable: true },
13 { id: "name", label: "Name", sortable: true },
14 { id: "role", label: "Role" },
15 {
16 id: "status",
17 label: "Status",
18 render: (value) => (
19 <span
20 style={{
21 color: value === "Active" ? "#10b981" : "#ef4444",
22 fontWeight: 600,
23 }}
24 >
25 {value}
26 </span>
27 ),
28 },
29];
30
31const data: User[] = [
32 { id: 1, name: "John Doe", role: "Admin", status: "Active" },
33 { id: 2, name: "Jane Smith", role: "User", status: "Inactive" },
34];
35
36export default function App() {
37 return (
38 <DataTable
39 data={data}
40 columns={columns}
41 tableId="user_management_table"
42 pagination={true}
43 filterColunm={true}
44 />
45 );
46}Core Features
Zero Heavy Dependencies
Only depends on @mui/material and react. No external icon sets.
Column Management
Built-in menu to show/hide columns with persistent state using localStorage.
Smart Sorting
Supports nested object properties via dot notation out of the box.
Professional UI
Modern design with micro-interactions and smooth skeleton loading states.
Next Steps
Explore the detailed API reference for the DataTable component to unlock its full potential.