This package contains the PRO Edition of SVAR React Excel Import, which provides extra features for production projects.
Depending on the license you purchased, you are granted the right to use this package under one of the following commercial licenses:
If you have technical questions about using SVAR React Excel Import, you can use our SVAR forum or contact us at support@svar.dev (please provide your license number).
To use the widget, import the package, render it while the import modal should be open, and pass the target fields the source columns can map to:
import { useState } from 'react';
import { ExcelImport } from '@svar/react-excel-import';
import '@svar/react-excel-import/all.css';
const fields = [
{ id: 'name', label: 'Name', required: true },
{ id: 'email', label: 'Email', required: true },
{ id: 'phone', label: 'Phone' },
];
export default function App() {
const [open, setOpen] = useState(false);
return (
<>
<button onClick={() => setOpen(true)}>Import Excel</button>
{open && (
<ExcelImport
fields={fields}
onImport={(rows, result) =>
console.log('Imported rows:', rows, result)
}
onClose={() => setOpen(false)}
/>
)}
</>
);
}See the docs to learn how to configure fields, mapping, validation, and integrations.