npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@codebiba/react-csv-editor

v1.0.1

Published

A powerful, feature-rich CSV viewer and editor React component with a beautiful dark UI

Readme

@codebiba/react-csv-editor

A 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.

npm version license


✨ Features

| Feature | Details | |---|---| | 📂 Upload | Drag-and-drop or browse to open any .csv file | | ✏️ Inline editing | Double-click any cell to edit; Enter / Esc / Tab to confirm or cancel | | ↩ Undo | 20-level undo history | | ➕ Add rows / columns | Modal forms with auto-detected data types | | 🗑 Delete | Multi-select rows with checkboxes, bulk delete | | 🔍 Search | Real-time full-table fuzzy search | | 🔽 Column filter | Filter by any column value, stack multiple filters | | ↕️ Sort | Click any header to sort asc/desc; type-aware (numbers, dates, strings) | | 📊 Sidebar stats | Live row/column/modified/selected counts | | 🏷 Type inference | Automatic detection of number, date, boolean, string columns | | 📄 Pagination | 50 rows per page | | ⬇️ Export | Download as .csv or use your own onExport handler | | 🎨 Beautiful UI | Dark theme with JetBrains Mono + Syne typography |


📦 Installation

npm install @codebiba/react-csv-editor
# or
yarn add @codebiba/react-csv-editor
# or
pnpm add @codebiba/react-csv-editor

Peer dependencies: react >= 17 and react-dom >= 17 must be installed in your project.


🚀 Quick Start

import { CSVEditor } from '@codebiba/react-csv-editor';
import '@codebiba/react-csv-editor/styles';

export default function App() {
  return (
    <div style={{ height: '100vh' }}>
      <CSVEditor />
    </div>
  );
}

⚠️ The component fills its container. Wrap it in an element with a defined height (e.g. 100vh).


🛠 Props

interface CSVEditorProps {
  /** Pre-load data without a file upload */
  initialData?: { headers: string[]; rows: Record<string, string>[] };

  /** Filename shown in the top bar */
  filename?: string;

  /** Called on every data mutation */
  onDataChange?: (data: { headers: string[]; rows: Record<string, string>[] }) => void;

  /** Override the default download behaviour */
  onExport?: (csvString: string, filename: string) => void;

  /** Show the "Load demo data" button in the empty state (default: true) */
  showDemo?: boolean;

  /** Extra CSS class for the root element */
  className?: string;

  /** Inline styles for the root element */
  style?: React.CSSProperties;
}

📖 Examples

Load data programmatically

import { CSVEditor } from '@codebiba/react-csv-editor';
import '@codebiba/react-csv-editor/styles';

const data = {
  headers: ['id', 'name', 'email'],
  rows: [
    { id: '1', name: 'Alice', email: '[email protected]' },
    { id: '2', name: 'Bob',   email: '[email protected]' },
  ],
};

export default function App() {
  return (
    <div style={{ height: '100vh' }}>
      <CSVEditor initialData={data} filename="contacts.csv" />
    </div>
  );
}

Controlled data with onDataChange

import { useState } from 'react';
import { CSVEditor } from '@codebiba/react-csv-editor';
import '@codebiba/react-csv-editor/styles';

export default function App() {
  const [csvData, setCsvData] = useState(null);

  return (
    <div style={{ height: '100vh' }}>
      <CSVEditor
        onDataChange={(data) => {
          setCsvData(data);
          console.log('rows:', data.rows.length);
        }}
      />
    </div>
  );
}

Custom export handler (e.g. upload to server)

import { CSVEditor } from '@codebiba/react-csv-editor';
import '@codebiba/react-csv-editor/styles';

export default function App() {
  const handleExport = async (csvString, filename) => {
    const blob = new Blob([csvString], { type: 'text/csv' });
    const formData = new FormData();
    formData.append('file', blob, filename);
    await fetch('/api/upload-csv', { method: 'POST', body: formData });
    alert('Uploaded successfully!');
  };

  return (
    <div style={{ height: '100vh' }}>
      <CSVEditor onExport={handleExport} />
    </div>
  );
}

Inside a Next.js app (App Router)

// app/csv/page.tsx
'use client';

import dynamic from 'next/dynamic';

const CSVEditor = dynamic(
  () => import('@codebiba/react-csv-editor').then((m) => m.CSVEditor),
  { ssr: false }
);

import '@codebiba/react-csv-editor/styles';

export default function Page() {
  return (
    <main style={{ height: '100vh' }}>
      <CSVEditor showDemo />
    </main>
  );
}

⌨️ Keyboard Shortcuts

| Key | Action | |-----|--------| | Double-click cell | Enter edit mode | | Enter | Confirm edit | | Escape | Cancel edit | | Tab | Confirm edit and move focus |


🏗 Development

git clone https://github.com/codebiba/react-csv-editor
cd react-csv-editor
npm install
npm run build   # production build → dist/
npm run dev     # watch mode

📄 License

MIT © Aditya Yaduvanshi