---
title: React
section: Guides
description: Step-by-step guide to installing and integrating the importOK component in your React project
---

Add a complete CSV and Excel importer to your React app, with column mapping, real-time validation, and API integration built in.


  @importok/react
  react-component

        
## Installation

Install both packages:

```bash
npm install @importok/javascript @importok/react
```

**Note**: The trial version is available on NPM. When you upgrade, you'll get access to our [private packages](/docs/private-packages) with full features. No code changes required.

## Your first importer

Create a basic contact importer:

```jsx
import ImportokWizard from '@importok/react';

function App() {
  // Define the fields you want to import
  const fields = {
    first_name: { label: 'First Name' },
    last_name: { label: 'Last Name' },
    email: { label: 'Email' },
    phone: { label: 'Phone' },
    country: { label: 'Country' }
  };

  return (
    
      
    
  );
}
```

That's it. Users can now upload CSV or Excel files and map columns to your fields.

## Make it production-ready

### Add data transformations

Clean up data before validation using [transformers](/docs/transformers):

```jsx
const fields = {
  first_name: {
    label: 'First Name',
    transformers: 'trim|capitalize'  // Built-in transformers
  },
  last_name: {
    label: 'Last Name',
    transformers: 'trim|capitalize'
  },
  email: {
    label: 'Email',
    transformers: 'trim'
  }
};
```

[See all built-in transformers →](/docs/transformers)

### Add validation rules

Catch errors before they reach your API using [validators](/docs/validators):

```jsx
const fields = {
  first_name: {
    label: 'First Name',
    transformers: 'trim|capitalize'
  },
  last_name: {
    label: 'Last Name',
    transformers: 'trim|capitalize',
    validators: 'required'  // Built-in validators
  },
  email: {
    label: 'Email',
    transformers: 'trim',
    validators: 'email|required'
  }
};
```

[See all built-in validators →](/docs/validators)

### Connect to your API

Send validated data to your backend:

```jsx
function App() {
  const fields = { /* ... */ };

  const handleImport = async function (records, meta) {
    const response = await fetch('/api/contacts/imports', {
      method: 'POST',
      headers: { 'Content-Type': 'application/json' },
      body: JSON.stringify(records)
    });
    
    return response;
  };

  return (
    
  );
}
```

## Complete example

Here's everything together:

```jsx
import ImportokWizard from '@importok/react';

function App() {
  const fields = {
    first_name: {
      label: 'First Name',
      transformers: 'trim|capitalize'
    },
    last_name: {
      label: 'Last Name',
      transformers: 'trim|capitalize',
      validators: 'required'
    },
    email: {
      label: 'Email',
      transformers: 'trim',
      validators: 'email|required'
    },
    phone: {
      label: 'Phone',
      transformers: 'trim'
    },
    country: {
      label: 'Country',
      transformers: 'trim',
      validators: 'in:countries'
    }
  };

  const handleImport = async function (records, meta) {
    return await fetch('/api/contacts/imports', {
      method: 'POST',
      headers: { 'Content-Type': 'application/json' },
      body: JSON.stringify(records)
    });
  };

  return (
    
      
    
  );
}
```

## Next steps

Now that you have a working importer, explore advanced features:

- **[Custom validators](/docs/validators)** - Add business-specific validation rules
- **[Custom transformers](/docs/transformers)** - Create domain-specific data cleanup
- **[Data providers](/docs/data-providers)** - Connect dropdowns to your API
- **[Props & events](/docs/component-props-events)** - Customize behavior and styling
- **[Field configuration](/docs/fields)** - Deep dive into field options

## Try it live

Experiment with a complete example in StackBlitz: [Open in StackBlitz →](https://stackblitz.com/~/github.com/importok/react-example?file=src%2FApp.js)

## Trial limitations

The free trial includes:

- ✅ Full UI and mapping features
- ✅ Built-in validators and transformers
- ⚠️ **20 records per import** (unlimited on paid plans)
- ⚠️ **Up to 2 custom validators** (unlimited on paid plans)
- ⚠️ **Up to 2 custom transformers** (unlimited on paid plans)
- ⚠️ **Up to 2 data providers** (unlimited on paid plans)

When you're ready, [upgrade to unlock full features](/pricing) with access to our [private packages](/docs/private-packages).
