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

@importkit/react

v0.3.1

Published

Drop-in CSV/Excel import widget for React with AI mapping, validation, theming, and templates

Readme

@importkit/react

Drop-in CSV/Excel import widget for React with AI-powered field mapping, validation, and enum value matching.

npm version License: MIT

Features

  • Drag & drop CSV and Excel file uploads
  • AI-powered mapping automatically matches CSV columns to your fields
  • Enum value mapping with intelligent matching (exact, case-insensitive, learned, AI semantic)
  • Real-time validation with inline editing to fix errors
  • Theming to match your brand
  • Templates for consistent imports across users

Installation

npm install @importkit/react

Quick Start

import { ImportWidget } from '@importkit/react';

function App() {
  return (
    <ImportWidget
      apiKey="your-api-key"
      fields={[
        { name: 'email', label: 'Email', type: 'email', required: true },
        { name: 'name', label: 'Full Name', required: true },
        { name: 'role', label: 'Role', type: 'enum', enum: { values: ['Admin', 'User', 'Guest'] } },
      ]}
      onComplete={(data) => {
        console.log('Imported rows:', data);
      }}
    />
  );
}

Props

| Prop | Type | Required | Description | |------|------|----------|-------------| | apiKey | string | Yes | Your ImportKit API key | | fields | Field[] | Yes* | Field definitions for mapping | | templateId | string | No | Use a saved template instead of inline fields | | onComplete | (data: ImportedRow[]) => void | Yes | Callback with validated data | | onError | (error: Error) => void | No | Error callback | | theme | ImportWidgetTheme | No | Custom styling | | showBranding | boolean | No | Show "Powered by ImportKit" (default: true) | | apiBaseUrl | string | No | Custom API URL (default: https://dashboard.importkit.app) |

*Required if templateId is not provided

Field Definition

interface Field {
  name: string;           // Internal field name
  label: string;          // Display label
  required?: boolean;     // Is this field required?
  type?: 'text' | 'email' | 'number' | 'date' | 'enum';
  enum?: EnumDefinition;  // For enum fields
  validate?: ValidationRule[];
}

interface EnumDefinition {
  values: string[];       // Allowed values
  hints?: string[];       // Alternative names for each value (same order as values)
  allowEmpty?: boolean;   // Allow empty values
  defaultValue?: string;  // Default if empty
}

Validation Rules

const fields = [
  {
    name: 'age',
    label: 'Age',
    type: 'number',
    validate: [
      { type: 'min', value: 0, message: 'Age must be positive' },
      { type: 'max', value: 150, message: 'Invalid age' },
    ],
  },
  {
    name: 'status',
    label: 'Status',
    validate: [
      { type: 'oneOf', value: ['active', 'inactive'], message: 'Must be active or inactive' },
    ],
  },
];

Available rules: email, number, regex, min, max, minLength, maxLength, oneOf

Enum Value Mapping

For enum fields, ImportKit uses a 6-step cascade to match source values:

  1. Exact match - "Admin""Admin"
  2. Case-insensitive - "admin""Admin"
  3. Customer learned - Previously corrected mappings for your account
  4. Global learned - Commonly used mappings across all users
  5. Hint matching - Matches against your provided hints
  6. AI semantic - Uses AI to match based on meaning ("Administrator""Admin")
{
  name: 'status',
  label: 'Status',
  type: 'enum',
  enum: {
    values: ['Active', 'Inactive', 'Pending'],
    hints: ['enabled,live', 'disabled,off', 'waiting,review'],
  }
}

Theming

<ImportWidget
  apiKey="..."
  fields={fields}
  onComplete={handleComplete}
  theme={{
    primaryColor: '#6366f1',    // Indigo
    successColor: '#22c55e',    // Green
    errorColor: '#ef4444',      // Red
    borderColor: '#e5e7eb',
    borderRadius: '12px',
    fontFamily: 'Inter, sans-serif',
    fontSize: '14px',
  }}
/>

Demo

Try the live demo: demo.importkit.app

Documentation

Full documentation: importkit.app

License

MIT