Data Table
wise-ui/data-tableFreeComponent
A fully-featured, animated data table with sorting, search, selection, inline editing, column resizing, and pagination.
Live preview
live · rendered by the registry
Rendered by wise-ui on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://wise-ui.com/r/data-table.jsonSource
1"use client"23import * as React from "react"4import { motion, AnimatePresence } from "motion/react"5import { cn } from "@/registry/wise-ui/lib/utils"67// ── Types ──────────────────────────────────────────────────────────────────────89export interface DataTableColumn<T> {10 key: keyof T & string11 label: string12 sortable?: boolean13 resizable?: boolean14 editable?: boolean15 width?: number16 render?: (value: T[keyof T], row: T) => React.ReactNode17}1819export interface DataTableProps<T extends { id: string | number }> {20 data: T[]21 columns: DataTableColumn<T>[]22 searchable?: boolean23 searchKeys?: (keyof T)[]24 selectable?: boolean25 onSelectionChange?: (rows: T[]) => void26 paginated?: boolean27 pageSize?: number28 className?: string29}3031type SortDir = "asc" | "desc" | null3233// ── Helpers ────────────────────────────────────────────────────────────────────3435function useDebounce<T>(value: T, delay: number): T {36 const [debounced, setDebounced] = React.useState(value)37 React.useEffect(() => {38 const t = setTimeout(() => setDebounced(value), delay)39 return () => clearTimeout(t)40 }, [value, delay])41 return debounced42}4344// ── Sub-components ─────────────────────────────────────────────────────────────4546function DataTableToolbar({47 searchValue,48 onSearchChange,49 totalRows,50 filteredRows,51}: {52 searchValue: string53 onSearchChange: (v: string) => void54 totalRows: number55 filteredRows: number56}) {57 return (58 <div className="flex items-center justify-between gap-4 pb-4">59 <div className="relative">60 <svg61 className="absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground"62 width="16"63 height="16"64 viewBox="0 0 24 24"65 fill="none"66 stroke="currentColor"67 strokeWidth="2"68 strokeLinecap="round"69 strokeLinejoin="round"70 >71 <circle cx="11" cy="11" r="8" />72 <path d="m21 21-4.3-4.3" />73 </svg>74 <input75 type="text"76 placeholder="Search..."77 value={searchValue}78// … truncated
What it pulls in
npm packages
Files it writes
More from wise-ui
All 20 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Animated Tabsanimated-tabs | wise-ui | Components | Free | 3 deps | |
| Border Beamborder-beam | wise-ui | Components | Free | 3 deps | |
| Dockdock | wise-ui | Components | Free | 3 deps | |
| Dot Matrixdot-matrix | wise-ui | Components | Free | 2 deps | |
| Editable Texteditable-text | wise-ui | Components | Free | 4 deps | |
| Gradient Sidebargradient-sidebar | wise-ui | Components | Free | 3 deps | |
| Kanban Boardkanban-board | wise-ui | Components | Free | 6 deps | |
| Magnetic Buttonmagnetic-button | wise-ui | Components | Free | 3 deps |
