Customers Table
A customers management section with a live-filtering search box, sortable column headers, checkbox row selection with a live selected count, a per-row action menu, and pagination over the full result set.
Docs
Installation
A real shadcn registry command, not a copy-paste stand-in: it fetches this block plus its button, badge, avatar, avatar-initials dependencies and any missing npm packages, and installs them straight into your project.
npx shadcn add https://staaarter.com/r/customers-table.jsonPrefer not to use the CLI? Copy the source from the Code toggle above into src/components/blocks/dashboard/dashboard2.tsx instead.
Usage
The file also exports dashboard2Demo, the exact props behind the preview above. Spread it to get a working section in one line, then replace it with your own data.
import { Dashboard2, dashboard2Demo } from "@/components/blocks/dashboard/dashboard2"; export default function Page() { return <Dashboard2 {...dashboard2Demo} />; }
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| customers | CustomerRow[] | none | Full customer list; search, sort, and pagination all operate over this array. |
| pageSize | number | 5 | Rows shown per page. |
| className | string | none | Extra classes for the outer section element. |
Types
type CustomerRow = { id: string; name: string; email: string; avatar?: { src: string; alt: string }; status: "Active" | "Inactive" | "Pending"; plan: string; spend: number; joined: string; // e.g. "2023-06-02", sorts correctly as an ISO date string };
Behavior notes
- The search box is a real live filter against name and email as you type, and it resets the page back to the first one on every keystroke.
- Clicking Name, Status, Spend, or Joined toggles a real ascending/descending sort on that column; clicking the same header again flips direction instead of resetting it.
- Row checkboxes and the header checkbox are real selection state; the header checkbox reflects and toggles selection across every filtered row, not just the visible page, and the "N selected" label above the table is live.
- Pagination (Prev/Next and the page indicator) is real state over the filtered, sorted array; the current page clamps down automatically if a search narrows the result set below it.
- The per-row "..." action menu opens a real inline menu, but its three actions (View profile, Edit customer, Deactivate) only close the menu on click, they don't mutate any data.
- Export and Add customer in the toolbar are inert buttons with no wired behavior.
More Dashboard Blocks
View all →admin-shell
Admin Shell
Full admin dashboard frame with a collapsible icon sidebar, command-palette trigger, KPI row, and recent-orders table.
commerce-analytics
Commerce Analytics
E-commerce analytics dashboard with a four-up KPI row, net-profit area chart, repeat-rate gauge, weekday bar chart, and a best-sellers table.
project-workspace
Project Workspace
Project-management dashboard with a highlighted stats row, weekly hours chart, meeting reminder, team list, progress gauge, and a focus tracker.
booking-workspace
Booking Workspace
Split hotel booking dashboard with tabbed overview, active booking cards, room timelines, and a month calendar with a day agenda.
talent-sourcing
Talent Sourcing
Recruiting project dashboard with a five-up stat strip, stage-filtered candidate pipeline, live search, and per-card wishlist/invite toggles.
traffic-analytics
Traffic Analytics
Web analytics console with a live-visitors strip, an hourly sessions area chart, a channel radar chart, a new-vs-returning line chart, and a sortable top-pages table.