# CSV Import block

> Five-Step CRM CSV Import Wizard with Column Mapping and Validation

Guides bulk CSV uploads into CRM contacts and deals via column mapping, row validation counts, and duplicate handling. ReUI Frame, Stepper, Badge, Alert; shadcn Select, RadioGroup, Table, Switch. Data import, bulk upload, onboarding wizard.

- Type: Pro block
- Category: [CRM](https://web.dev.reui.io/blocks/solutions/crm.md)
- Page: https://web.dev.reui.io/blocks/solutions/crm/solution-crm-6
- MCP: `get_block("solution-crm-6")`
- Built with: Alert, Badge, Button, Field, Frame, Item, Radio Group, Select, Spinner, Stepper, Switch, Table
- Installs with a ReUI Pro or Ultimate license; setup: https://web.dev.reui.io/docs/license-setup

## Best for

A 5 step CSV import that maps 8 columns to CRM fields, flags preview rows and sets skip, update or create for duplicates

## Agent notes

- `useFileUpload` feeds only a label to `onFileChange`; no CSV is parsed, so `PREVIEW_ROWS` and `VALIDATION_SUMMARY` stay fixed
- `handleSubmit` fakes the import with a 900 ms timer, then a toast reports the fixed `IMPORT_RESULT`; call your import API there
- `DEFAULT_MAPPING_ROWS` seeds 8 source columns, and `getStepErrors` blocks the Map step while a required one such as Owner stays `unmapped`

## When not to use

- A short 3 step setup form with a review summary and no file to upload: use [Billing Setup](https://web.dev.reui.io/blocks/application/wizard/wizard-1.md) (`get_block("wizard-1")`)
- A workspace setup with a left rail of numbered steps: use [Sidebar Stepper Wizard](https://web.dev.reui.io/blocks/application/onboarding/onboarding-2.md) (`get_block("onboarding-2")`)

## Third-party libraries

- Sonner v2: [API reference](https://sonner.emilkowal.ski/toast), [docs](https://sonner.emilkowal.ski/getting-started)

## Install

```bash
npx shadcn@latest add @reui/solution-crm-6
```

## About CRM blocks

### When to use

- A sales team's deal work: a pipeline board, a deal grid, a forecast call or the record of one deal
- The contact side of sales: a contacts directory, an activity log across accounts and a CSV import
- A sales overview of open pipeline, weighted forecast and win rate above the open deals

### When not to use

- Cards for tasks or tickets moved across columns, with no deal value or close date: use the [Kanban Board blocks](https://web.dev.reui.io/blocks/application/kanban-board.md)
- A records table with sorting, paging and row selection, outside a sales context: use the [Base blocks](https://web.dev.reui.io/blocks/data-grid/base.md)
- A side panel for one record that is not a deal, such as an order or a user: use the [Sheet blocks](https://web.dev.reui.io/blocks/application/sheet.md)

### Agent notes

- Each block sizes its page with `min-h-svh`, or `h-svh` on the Deal Desk, in page.tsx or its root component; size it from your app shell instead
- Every change lives in `useState` or a `useReducer` store and resets on reload; no block calls an API or writes to storage

Every ReUI item has a twin like this one; the index is https://web.dev.reui.io/llms.txt. Agents with the ReUI MCP (https://web.dev.reui.io/docs/mcp) get the same guidance from the getters named above.
