CSV Importer
Smart CSV import UI with column mapping, data validation, preview table, and error highlighting. Handles large files with streaming and shows progress for batch imports.
ReactDataBuilt with Cursor
980
Stars
4.5k
Installs
2
Deps
2
Comments
Install / Copy
npx create-freestack-module csv-importerCode Preview
index.tsx
import Papa from "papaparse";
export function CSVImporter({ schema, onImport }) {
const [step, setStep] = useState("upload"); // upload | map | preview | done
const [data, setData] = useState([]);
const [mapping, setMapping] = useState({});
const handleFile = (file: File) => {
Papa.parse(file, {
header: true,
complete: (results) => {
setData(results.data);
setMapping(autoMapColumns(results.meta.fields, schema));
setStep("map");
},
});
};
const handleImport = async () => {
const mapped = data.map((row) => applyMapping(row, mapping, schema));
const { valid, errors } = validate(mapped, schema);
if (errors.length > 0) return showErrors(errors);
await onImport(valid);
setStep("done");
};
}DA
dataops3 days ago
The auto column mapping is surprisingly accurate. Handles messy CSV headers well.
PM
pmdev1 week ago
Used this for our client data migration tool. The preview step gives users confidence.
Related Modules
Kanban Board
Drag-and-drop Kanban board with real-time sync via WebSockets. Supports multiple boards, swimlanes, card assignments, and priority labels out of the box.
2.3kReact
Data Table Pro
Full-featured data table with sorting, filtering, pagination, column resizing, and CSV export. Built on TanStack Table with a clean, customizable UI.
1.9kReact
File Uploader
Drag-and-drop file upload component with progress bars, file type validation, and direct S3/R2 integration. Supports multi-file uploads and image previews.
1.4kReact