Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the tables resizable! #909

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 26 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# [Shadcn Table](https://table.sadmn.com)
# [Resizable Shadcn Table](https://resizable-shadcn-table.vercel.app)

Forked from [Shadcn Table](https://table.sadmn.com)

This is a shadcn table with server-side sorting, filtering, and pagination. It is bootstrapped with `create-t3-app`.

[![Shadcn Table](./public/images/screenshot.png)](https://table.sadmn.com)
[![Resizable Shadcn Table](./public/images/screenshot.png)](https://table.sadmn.com)

> **Warning**
> This project is still in development and is not ready for production use.
Expand Down Expand Up @@ -51,15 +53,35 @@ This is a shadcn table with server-side sorting, filtering, and pagination. It i
4. Start the development server

```bash
pnpm run dev
pnpm dev
```

5. Push the database schema

```bash
pnpm run db:push
pnpm db:push
```

6. Use drizzle studio to import CSV data

```bash
pnpm db:studio
```

7. To import CSV data without deleting existing data, use the following command:

```bash
pnpm db:import-csv
```

8. To import CSV data and delete existing data, use the following command:

```bash
pnpm db:import-csv:clean
```

Both the above commands will automatically revalidate the next cache. If it fails to do so, restart the development server. By default, the data is imported from tasks.csv file in the root directory. (maybe I'll change it later to accept a file name as an argument)

## Build your own Table

1. Copy the following folders and files into your project (configured with ) at the exact specific locations
Expand Down
11 changes: 7 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"scripts": {
"clean": "rimraf --glob **/node_modules **/dist **/.next pnpm-lock.yaml **/.tsbuildinfo",
"build": "next build",
"dev": "next dev",
"dev": "next dev --turbopack",
"start": "next start",
"lint": "biome check .",
"lint:fix": "biome check . --write",
Expand All @@ -19,7 +19,9 @@
"db:migrate": "dotenv tsx src/db/migrate.ts",
"db:drop-migration": "drizzle-kit drop",
"db:seed": "dotenv tsx src/db/seed.ts",
"db:studio": "dotenv drizzle-kit studio"
"db:studio": "dotenv drizzle-kit studio",
"db:import-csv": "dotenv tsx src/scripts/import-csv.ts",
"db:import-csv:clean": "dotenv tsx src/scripts/import-csv.ts --delete-existing"
},
"dependencies": {
"@dnd-kit/core": "^6.3.1",
Expand All @@ -44,6 +46,7 @@
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"cmdk": "^1.0.4",
"csv-parse": "^5.6.0",
"date-fns": "^4.1.0",
"drizzle-orm": "^0.40.0",
"export-to-csv": "^1.4.0",
Expand All @@ -52,6 +55,7 @@
"nanoid": "^5.0.9",
"next": "^15.1.6",
"next-themes": "^0.4.4",
"node-fetch": "^3.3.2",
"nuqs": "^2.3.1",
"postgres": "^3.4.5",
"react": "^19.0.0",
Expand Down Expand Up @@ -84,6 +88,5 @@
},
"ct3aMetadata": {
"initVersion": "7.23.1"
},
"packageManager": "[email protected]"
}
}
Loading