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

@bernierllc/csv-ui

v0.3.0

Published

React components for CSV import interfaces with drag-and-drop, column mapping, validation, and real-time feedback

Readme

@bernierllc/csv-ui

React components for CSV import interfaces with drag-and-drop, column mapping, validation, and real-time feedback.

Installation

npm install @bernierllc/csv-ui

Features

  • File Upload - Drag-and-drop CSV file upload with validation
  • Column Mapping - Visual column-to-field mapping with auto-suggestions
  • Data Preview - Interactive data preview with validation highlighting
  • Import Wizard - Complete step-by-step import workflow
  • Real-time Validation - Live validation feedback with error correction
  • Accessibility - WCAG 2.1 AA compliant with full keyboard navigation
  • TypeScript - Full TypeScript support with comprehensive type definitions

Quick Start

import { CSVImportWizard } from '@bernierllc/csv-ui';

const schema = {
  fields: [
    { name: 'name', type: 'string', required: true },
    { name: 'email', type: 'string', required: true },
    { name: 'age', type: 'number', required: false }
  ]
};

function MyComponent() {
  const handleComplete = (result) => {
    console.log('Import completed:', result);
  };

  return (
    <CSVImportWizard
      onComplete={handleComplete}
      initialSchema={schema}
      title="Import Users"
    />
  );
}

Components

CSVImportWizard

Complete wizard component that handles the entire CSV import flow:

<CSVImportWizard
  onComplete={(result) => console.log(result)}
  onCancel={() => console.log('cancelled')}
  initialSchema={schema}
  allowedFileTypes={['.csv', '.txt']}
  maxFileSize={10 * 1024 * 1024}
  validationEnabled={true}
/>

FileUpload

Drag-and-drop file upload component:

<FileUpload
  onFileSelect={(file) => console.log(file)}
  acceptedTypes={['.csv', '.txt']}
  maxSize={5 * 1024 * 1024}
/>

ColumnMapper

Visual column mapping interface:

<ColumnMapper
  headers={['Name', 'Email', 'Age']}
  schema={schema}
  mapping={mapping}
  onMappingChange={setMapping}
  onAutoMap={() => console.log('auto-map')}
/>

DataPreview

Interactive data preview with validation:

<DataPreview
  data={csvData}
  schema={schema}
  mapping={mapping}
  validationErrors={errors}
  maxRows={50}
/>

ValidationDisplay

Validation results with error details:

<ValidationDisplay
  errors={validationErrors}
  showSuggestions={true}
  onErrorClick={(error) => console.log(error)}
/>

Hooks

useCSVImport

Complete CSV import state management:

const {
  currentStep,
  file,
  data,
  schema,
  mapping,
  validationErrors,
  isProcessing,
  setFile,
  setMapping,
  nextStep,
  startImport
} = useCSVImport({
  initialSchema: schema,
  onComplete: (result) => console.log(result)
});

useColumnMapping

Column mapping utilities:

const {
  mapping,
  suggestions,
  autoMap,
  mapColumn,
  clearMapping
} = useColumnMapping({
  headers: csvHeaders,
  schema: importSchema,
  onMappingChange: setMapping
});

TypeScript

All components are fully typed. Import types as needed:

import type {
  ImportSchema,
  ColumnMapping,
  ValidationError,
  ImportResult,
  FileUploadProps,
  CSVImportWizardProps
} from '@bernierllc/csv-ui';

Styling

Components use Tailwind CSS classes. Include Tailwind in your project or provide custom styles.

Accessibility

  • Full keyboard navigation support
  • Screen reader compatible
  • WCAG 2.1 AA compliant
  • Focus management and ARIA labels
  • High contrast support

License

Copyright (c) 2025 Bernier LLC. All rights reserved.