{"_id":"@codebiba/react-csv-editor","_rev":"2-123c62cb1a48a821594d5114081b5065","name":"@codebiba/react-csv-editor","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.0":{"name":"@codebiba/react-csv-editor","version":"1.0.0","keywords":["csv","csv-editor","csv-viewer","react","table","data-grid","spreadsheet","dark-ui","shadcn"],"author":{"name":"Codebiba"},"license":"MIT","_id":"@codebiba/react-csv-editor@1.0.0","maintainers":[{"name":"adityayaduvanshi","email":"aditya97y@gmail.com"}],"homepage":"https://github.com/adityayaduvanshi/react-csv-editor#readme","bugs":{"url":"https://github.com/adityayaduvanshi/react-csv-editor/issues"},"dist":{"shasum":"1a7108af31b5ac3530ef49acbeb1782092fc0e2a","tarball":"https://registry.npmjs.org/@codebiba/react-csv-editor/-/react-csv-editor-1.0.0.tgz","fileCount":8,"integrity":"sha512-LydRruVvOhi3xm4sH+zqDryvgwBe8T6g1RT9KmL8qieEW7MqpmJV+Iuiu1tQtZ9tstTHtdz8GGhxQKCLAU7Iew==","signatures":[{"sig":"MEQCIBdBWT2nvQgYfb2GWCljsNXpHaqP+zWXuUwNyTtI+9GXAiBd5mZMXb89K2q583VsU9XXgXBremxxBOq76xdiWK1Nog==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":160646},"main":"dist/index.cjs.js","types":"dist/index.d.ts","module":"dist/index.esm.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.esm.js","require":"./dist/index.cjs.js"},"./styles":"./dist/styles.css"},"scripts":{"dev":"rollup -c -w","lint":"eslint src","build":"rollup -c","prepublishOnly":"npm run build"},"_npmUser":{"name":"adityayaduvanshi","email":"aditya97y@gmail.com"},"repository":{"url":"git+https://github.com/adityayaduvanshi/react-csv-editor.git","type":"git"},"_npmVersion":"10.9.4","description":"A powerful, feature-rich CSV viewer and editor React component with a beautiful dark UI","directories":{},"_nodeVersion":"22.21.0","_hasShrinkwrap":false,"devDependencies":{"rollup":"^4.6.0","postcss":"^8.5.8","@babel/core":"^7.23.0","@babel/preset-env":"^7.23.0","@babel/preset-react":"^7.22.0","@rollup/plugin-babel":"^6.0.4","@rollup/plugin-terser":"^0.4.4","rollup-plugin-postcss":"^4.0.2","@rollup/plugin-commonjs":"^25.0.7","@rollup/plugin-node-resolve":"^15.2.3","rollup-plugin-peer-deps-external":"^2.2.4"},"peerDependencies":{"react":">=17.0.0","react-dom":">=17.0.0"},"_npmOperationalInternal":{"tmp":"tmp/react-csv-editor_1.0.0_1773271167656_0.8585764231300188","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@codebiba/react-csv-editor","version":"1.0.1","description":"A powerful, feature-rich CSV viewer and editor React component with a beautiful dark UI","main":"dist/index.cjs.js","module":"dist/index.esm.js","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.esm.js","require":"./dist/index.cjs.js","types":"./dist/index.d.ts"},"./styles":"./dist/styles.css"},"scripts":{"build":"rollup -c","dev":"rollup -c -w","lint":"eslint src","prepublishOnly":"npm run build"},"keywords":["csv","csv-editor","csv-viewer","react","table","data-grid","spreadsheet","dark-ui","shadcn"],"author":{"name":"Codebiba"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/adityayaduvanshi/react-csv-editor.git"},"peerDependencies":{"react":">=17.0.0","react-dom":">=17.0.0"},"devDependencies":{"@babel/core":"^7.23.0","@babel/preset-env":"^7.23.0","@babel/preset-react":"^7.22.0","@rollup/plugin-babel":"^6.0.4","@rollup/plugin-commonjs":"^25.0.7","@rollup/plugin-node-resolve":"^15.2.3","@rollup/plugin-terser":"^0.4.4","postcss":"^8.5.8","rollup":"^4.6.0","rollup-plugin-peer-deps-external":"^2.2.4","rollup-plugin-postcss":"^4.0.2"},"_id":"@codebiba/react-csv-editor@1.0.1","bugs":{"url":"https://github.com/adityayaduvanshi/react-csv-editor/issues"},"homepage":"https://github.com/adityayaduvanshi/react-csv-editor#readme","_nodeVersion":"22.21.0","_npmVersion":"10.9.4","dist":{"integrity":"sha512-qHr9fsu28yPzJ9jjKw6EbJyv7EFQ76DsvHqYV+i6895SS6zmaczUqzbtuiZQy8B3paoWLXoUJNTyXslijU2nqg==","shasum":"3669a89747657d06142d7d45824eb92acedf4c79","tarball":"https://registry.npmjs.org/@codebiba/react-csv-editor/-/react-csv-editor-1.0.1.tgz","fileCount":8,"unpackedSize":160671,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQC1n3MiM9r9FJjN8O/g3hWWq2oxraXA/8xdtWu1JX93iAIgUc8I3jwfozfEgUt8YvHN2Sjq0NQLkILw613uF4AtpAs="}]},"_npmUser":{"name":"adityayaduvanshi","email":"aditya97y@gmail.com"},"directories":{},"maintainers":[{"name":"adityayaduvanshi","email":"aditya97y@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/react-csv-editor_1.0.1_1773271388195_0.5783632948747384"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-11T23:19:27.559Z","modified":"2026-03-11T23:23:08.496Z","1.0.0":"2026-03-11T23:19:27.886Z","1.0.1":"2026-03-11T23:23:08.356Z"},"bugs":{"url":"https://github.com/adityayaduvanshi/react-csv-editor/issues"},"author":{"name":"Codebiba"},"license":"MIT","homepage":"https://github.com/adityayaduvanshi/react-csv-editor#readme","keywords":["csv","csv-editor","csv-viewer","react","table","data-grid","spreadsheet","dark-ui","shadcn"],"repository":{"type":"git","url":"git+https://github.com/adityayaduvanshi/react-csv-editor.git"},"description":"A powerful, feature-rich CSV viewer and editor React component with a beautiful dark UI","maintainers":[{"name":"adityayaduvanshi","email":"aditya97y@gmail.com"}],"readme":"# @codebiba/react-csv-editor\n\nA powerful, feature-rich CSV viewer and editor for React — with a beautiful dark UI, inline cell editing, sorting, filtering, undo/redo, and instant CSV export.\n\n[![npm version](https://img.shields.io/npm/v/@codebiba/react-csv-editor.svg)](https://www.npmjs.com/package/@codebiba/react-csv-editor)\n[![license](https://img.shields.io/npm/l/@codebiba/react-csv-editor.svg)](LICENSE)\n\n---\n\n## ✨ Features\n\n| Feature | Details |\n|---|---|\n| 📂 **Upload** | Drag-and-drop or browse to open any `.csv` file |\n| ✏️ **Inline editing** | Double-click any cell to edit; `Enter` / `Esc` / `Tab` to confirm or cancel |\n| ↩ **Undo** | 20-level undo history |\n| ➕ **Add rows / columns** | Modal forms with auto-detected data types |\n| 🗑 **Delete** | Multi-select rows with checkboxes, bulk delete |\n| 🔍 **Search** | Real-time full-table fuzzy search |\n| 🔽 **Column filter** | Filter by any column value, stack multiple filters |\n| ↕️ **Sort** | Click any header to sort asc/desc; type-aware (numbers, dates, strings) |\n| 📊 **Sidebar stats** | Live row/column/modified/selected counts |\n| 🏷 **Type inference** | Automatic detection of number, date, boolean, string columns |\n| 📄 **Pagination** | 50 rows per page |\n| ⬇️ **Export** | Download as `.csv` or use your own `onExport` handler |\n| 🎨 **Beautiful UI** | Dark theme with `JetBrains Mono` + `Syne` typography |\n\n---\n\n## 📦 Installation\n\n```bash\nnpm install @codebiba/react-csv-editor\n# or\nyarn add @codebiba/react-csv-editor\n# or\npnpm add @codebiba/react-csv-editor\n```\n\n> **Peer dependencies:** `react >= 17` and `react-dom >= 17` must be installed in your project.\n\n---\n\n## 🚀 Quick Start\n\n```tsx\nimport { CSVEditor } from '@codebiba/react-csv-editor';\nimport '@codebiba/react-csv-editor/styles';\n\nexport default function App() {\n  return (\n    <div style={{ height: '100vh' }}>\n      <CSVEditor />\n    </div>\n  );\n}\n```\n\n> ⚠️ The component fills its container. Wrap it in an element with a defined height (e.g. `100vh`).\n\n---\n\n## 🛠 Props\n\n```tsx\ninterface CSVEditorProps {\n  /** Pre-load data without a file upload */\n  initialData?: { headers: string[]; rows: Record<string, string>[] };\n\n  /** Filename shown in the top bar */\n  filename?: string;\n\n  /** Called on every data mutation */\n  onDataChange?: (data: { headers: string[]; rows: Record<string, string>[] }) => void;\n\n  /** Override the default download behaviour */\n  onExport?: (csvString: string, filename: string) => void;\n\n  /** Show the \"Load demo data\" button in the empty state (default: true) */\n  showDemo?: boolean;\n\n  /** Extra CSS class for the root element */\n  className?: string;\n\n  /** Inline styles for the root element */\n  style?: React.CSSProperties;\n}\n```\n\n---\n\n## 📖 Examples\n\n### Load data programmatically\n\n```tsx\nimport { CSVEditor } from '@codebiba/react-csv-editor';\nimport '@codebiba/react-csv-editor/styles';\n\nconst data = {\n  headers: ['id', 'name', 'email'],\n  rows: [\n    { id: '1', name: 'Alice', email: 'alice@example.com' },\n    { id: '2', name: 'Bob',   email: 'bob@example.com' },\n  ],\n};\n\nexport default function App() {\n  return (\n    <div style={{ height: '100vh' }}>\n      <CSVEditor initialData={data} filename=\"contacts.csv\" />\n    </div>\n  );\n}\n```\n\n### Controlled data with `onDataChange`\n\n```tsx\nimport { useState } from 'react';\nimport { CSVEditor } from '@codebiba/react-csv-editor';\nimport '@codebiba/react-csv-editor/styles';\n\nexport default function App() {\n  const [csvData, setCsvData] = useState(null);\n\n  return (\n    <div style={{ height: '100vh' }}>\n      <CSVEditor\n        onDataChange={(data) => {\n          setCsvData(data);\n          console.log('rows:', data.rows.length);\n        }}\n      />\n    </div>\n  );\n}\n```\n\n### Custom export handler (e.g. upload to server)\n\n```tsx\nimport { CSVEditor } from '@codebiba/react-csv-editor';\nimport '@codebiba/react-csv-editor/styles';\n\nexport default function App() {\n  const handleExport = async (csvString, filename) => {\n    const blob = new Blob([csvString], { type: 'text/csv' });\n    const formData = new FormData();\n    formData.append('file', blob, filename);\n    await fetch('/api/upload-csv', { method: 'POST', body: formData });\n    alert('Uploaded successfully!');\n  };\n\n  return (\n    <div style={{ height: '100vh' }}>\n      <CSVEditor onExport={handleExport} />\n    </div>\n  );\n}\n```\n\n### Inside a Next.js app (App Router)\n\n```tsx\n// app/csv/page.tsx\n'use client';\n\nimport dynamic from 'next/dynamic';\n\nconst CSVEditor = dynamic(\n  () => import('@codebiba/react-csv-editor').then((m) => m.CSVEditor),\n  { ssr: false }\n);\n\nimport '@codebiba/react-csv-editor/styles';\n\nexport default function Page() {\n  return (\n    <main style={{ height: '100vh' }}>\n      <CSVEditor showDemo />\n    </main>\n  );\n}\n```\n\n---\n\n## ⌨️ Keyboard Shortcuts\n\n| Key | Action |\n|-----|--------|\n| `Double-click` cell | Enter edit mode |\n| `Enter` | Confirm edit |\n| `Escape` | Cancel edit |\n| `Tab` | Confirm edit and move focus |\n\n---\n\n## 🏗 Development\n\n```bash\ngit clone https://github.com/codebiba/react-csv-editor\ncd react-csv-editor\nnpm install\nnpm run build   # production build → dist/\nnpm run dev     # watch mode\n```\n\n---\n\n## 📄 License\n\nMIT © [Aditya Yaduvanshi](https://github.com/adityayaduvanshi)\n","readmeFilename":"README.md"}