# Configure columns

> Columns define the records your application expects. CSVJetty uses them for header matching, validation, conversion, examples, and delivered record keys.

Canonical HTML: https://www.csvjetty.com/docs/columns


![CSVJetty destination field configuration](https://www.csvjetty.com/1_DemoAdminColumnDefinition.png)

Define the destination fields before matching uploaded headers.

## Dashboard or code

Configure columns in the dashboard for a reusable importer. Pass a `columns` prop when you need runtime overrides for a particular import session.

```jsx
<CSVJetty
  importerKey="YOUR_IMPORTER_KEY"
  columns={[
    {
      name: "name",
      label: "Full name",
      type: "text",
      required: true,
      aliases: ["full_name", "contact_name"],
      example: "Ada Lovelace",
    },
    {
      name: "email",
      label: "Email address",
      type: "email",
      required: true,
      validate(value) {
        if (!String(value || "").endsWith("@example.com")) {
          return "Use an example.com email address.";
        }
      },
    },
  ]}
  onData={async ({ rows }) => {
    console.log(rows);
  }}
>
  Import contacts
</CSVJetty>
```

Passing `columns` replaces the importer's saved dashboard columns for that import session.

## Column properties

| Property | Purpose |
| --- | --- |
| `name` | Unique output key. Starts with a letter and may contain letters, digits, or underscores; up to 50 characters. |
| `label` | Human-readable field label shown to the importer. |
| `type` | Validation and conversion type. |
| `required` | Requires a column match and a nonempty value. |
| `aliases` | Alternative uploaded header names used for automatic matching. |
| `options` | Allowed values for select fields. |
| `pattern` | Regular expression used by regex fields. |
| `example` | Example value shown to explain expected data. |
| `description` | Additional guidance about the field. |
| `validate(value, record)` | Synchronous custom validator that runs in the application. |

## Field types

CSVJetty supports `text`, `email`, `number`, `date`, `select`, `phone`, `url`, `currency`, `boolean`, and `regex`.

Dates use `YYYY-MM-DD`. Valid number and currency values are delivered as JavaScript numbers. Valid boolean values are delivered as booleans.

## Custom validation

```js
{
  name: "email",
  label: "Email",
  type: "email",
  validate(value, record) {
    if (record.status === "active" && !value) {
      return "Email is required for active contacts.";
    }
  },
}
```

Custom validators are synchronous. Checks requiring a database or external service belong on the server after delivery.

## Invalid-row behavior

- **Skip invalid rows** excludes invalid rows from delivery.
- **Require valid rows** blocks the import until every row is valid.
- If both are disabled, users can continue with values that still fail CSVJetty validation.

See [Validation and corrections](https://www.csvjetty.com/docs/concepts/validation) and [Importer settings](https://www.csvjetty.com/docs/settings).
