Welcome to an example of Shadcn DataTable React - This is a simple example that was built based on Shadcn DataTable documentation and Tenstack Table editable example. Each table have pagination which was implemented based on Shadcn example here. The project uses Zod for cell validation and Tailwind CSS for styling.
This example is intended to gather what is out there fragmented in the internet, hopefully it helps you as much as it helps me. Project created based on Aszusz template zero-to-react.
Before you begin, ensure you have installed:
- pnpm (recommended) or npm
- Clone the repository:
git clone https://github.com/yourusername/shadcn-datatable-react.git
cd shadcn-datatable-react
- Install dependencies:
npm install
- Start the development server:
npm run dev
- Open your browser and visit
http://localhost:5173
To create a production build:
npm run build
src/
├── components/
│ └── dataTable/ # Table components
│ ├── columns/ # Column definitions
│ └── ...
├── lib/ # Utility functions
├── models/ # TypeScript types and models
└── view/ # React components
- Ready-to-Use Data Table Solution
- Pre-configured table components with common features
- Editable cells implementation
- Built-in validation using Zod
This project is built with:
- Vite
- TanStack Table (React Table) v8
- Tailwind CSS
- Zod