Supabase Data Table
shadcn-ui-blocks-shadcnship/data-table-01FreeBlock
Paginated data table with global search and sortable columns. Two modes: pass a data array for client-side rendering, or a Supabase table name for server-side pagination. Supports text, date, badge, tags, and status cell types.
See it running
Open the demo on shadcn-ui-blocks
shadcnship.com/blocks/data-table-01Install it
npx shadcn@latest add https://shadcnship.com/r/data-table-01.jsonSource
1import { DataTableClient } from "./components/client";2import { getData } from "./data-table-actions";3import { DEMO_DATA } from "./data/demo";4import type { ColumnDef, CellType } from "./lib/utils";56const SEARCHABLE_TYPES = new Set<CellType>(["text", "badge", "status"]);78// ─────────────────────────────────────────────────────────────────────────────9// Row type — adapt fields to your own data model10// ─────────────────────────────────────────────────────────────────────────────1112export type Row = {13 id: string;14 name: string;15 email: string;16 status: "active" | "inactive" | "pending";17 category: string;18 tags?: string[];19 created_at: string;20};2122// ─────────────────────────────────────────────────────────────────────────────23// Column definitions — customize to your data model24// ─────────────────────────────────────────────────────────────────────────────2526export const COLUMNS: ColumnDef<Row>[] = [27 { key: "name", header: "Name", type: "text", sortable: true },28 { key: "email", header: "Email", type: "text" },29 {30 key: "status",31 header: "Status",32 type: "status",33 statusConfig: {34 active: { label: "Active", dot: "bg-green-500" },35 inactive: { label: "Inactive", dot: "bg-muted-foreground" },36 pending: { label: "Pending", dot: "bg-amber-500" },37 },38 },39 { key: "category", header: "Category", type: "badge" },40 { key: "tags", header: "Tags", type: "tags" },41 {42 key: "created_at",43 header: "Date",44 type: "date",45 align: "right",46 sortable: true,47 },48];4950// ─────────────────────────────────────────────────────────────────────────────51// Config52// … truncated
What it pulls in
npm packages
Other registry items
Files it writes
More from shadcn-ui-blocks
All 74 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Square Grid Backgroundbackground-01 | shadcn-ui-blocks | Blocks | Free | no deps | |
| Dot Pattern Backgroundbackground-02 | shadcn-ui-blocks | Blocks | Free | no deps | |
| Diagonal Stripes Backgroundbackground-03 | shadcn-ui-blocks | Blocks | Free | no deps | |
| Vertical Lines Backgroundbackground-04 | shadcn-ui-blocks | Blocks | Free | no deps | |
| Interactive Grid Backgroundbackground-05 | shadcn-ui-blocks | Blocks | Free | no deps | |
| Banner 01banner-01 | shadcn-ui-blocks | Blocks | Free | 1 dep | |
| Blog 01blog-01 | shadcn-ui-blocks | Blocks | Free | no deps | |
| Changelog 01changelog-01 | shadcn-ui-blocks | Blocks | Free | no deps |
