terra vidhal

Csv Import Mapper

Component

About

A three-step CSV import mapper with automatic column mapping, type validation, row-level review, animated progress and safe skipping.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Csv Import Mapper to your project and fits it to your theme.

Code

How Csv Import Mapper is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

"use client";

/**
 * PrequelUI Animate — MIT — https://prequeluianimate.terravidhal.me
 */

import {
  CsvImportMapper,
  type ImportField,
  type ImportRow,
} from "@/components/ui/csv-import-mapper";

const HEADERS = ["Full name", "Email address", "Company", "Seats", "Signed up", "Notes"];

const FIELDS: ImportField[] = [
  { key: "name", label: "Customer name", required: true, type: "text" },
  { key: "email", label: "Email", required: true, type: "email" },
  { key: "company", label: "Company", type: "text" },
  { key: "seats", label: "Seats", type: "number" },
  { key: "signedup", label: "Signed up", type: "date" },
  { key: "notes", label: "Notes", type: "text" },
];

const ROWS: ImportRow[] = [
  {
    "Full name": "Mara Ellison",
    "Email address": "mara.ellison@example.com",
    Company: "Design studio",
    Seats: "12",
    "Signed up": "2026-09-14",
    Notes: "Annual plan",
  },
  {
    "Full name": "Theo Nakamura",
    "Email address": "theo.nakamura@example.com",
    Company: "Research group",
    Seats: "4",
    "Signed up": "2026-09-18",
    Notes: "Trial extended once",
  },
  {
    "Full name": "Priya Raman",
    "Email address": "priya.raman@",
    Company: "Logistics team",
    Seats: "28",
    "Signed up": "2026-09-20",
    Notes: "Missing email domain",
  },
  {
    "Full name": "",
    "Email address": "jonas.weber@example.com",
    Company: "Independent",
    Seats: "1",
    "Signed up": "2026-09-22",
    Notes: "Name missing from the source",
  },
  {
    "Full name": "Lena Fischer",
    "Email address": "lena.fischer@example.com",
    Company: "Operations",
    Seats: "many",
    "Signed up": "2026-09-25",
    Notes: "Seat count is text",
  },
  {
    "Full name": "Owen Clarke",
    "Email address": "owen.clarke@example.com",
    Company: "Field team",
    Seats: "6",
    "Signed up": "not-a-date",
    Notes: "Date format is wrong",
  },
  {
    "Full name": "Sofia Duarte",
    "Email address": "sofia.duarte@example.com",
    Company: "Studio",
    Seats: "9",
    "Signed up": "2026-09-29",
    Notes: "Ready to import",
  },
  {
    "Full name": "Noah Bennett",
    "Email address": "noah.bennett@example.com",
    Company: "Product group",
    Seats: "15",
    "Signed up": "2026-10-02",
    Notes: "Ready to import",
  },
];

export default function CsvImportMapperDemo() {
  return (
    <main className="flex min-h-screen w-full items-center justify-center bg-gradient-to-b from-muted/40 via-background to-background px-4 py-6 sm:px-6">
      <CsvImportMapper
        variant="plain"
        fileName="customer-import.csv"
        headers={HEADERS}
        rows={ROWS}
        fields={FIELDS}
        title="Import customer accounts"
        defaultStep="review"
      />
    </main>
  );
}

Dependencies

More by terra vidhal

View all
  • Project Timeline

    Project Timeline

    30
  • Kanban Board

    Kanban Board

    20
  • Gravity Stars Background

    Gravity Stars Background

    20
  • Booking Calendar

    Booking Calendar

    18
  • Notification Center

    Notification Center

    16
  • Audio Waveform

    Audio Waveform

    16
  • Kpi Counter

    Kpi Counter

    16
  • Topographic Lines

    Topographic Lines

    16

Explore more

Part of PrequelUI Animate — browse the full library on 21st.dev.