Ivandt logo

Text Field

Simple text input field for string values

The text field is the most basic field type with no special formatting or validation. It accepts any string value.

Basic Usage

{
  type: 'text',
  label: 'Full Name',
  key: 'fullName',
  order: 0
}

Properties

All text fields support the common field properties.

Use Cases

  • Names, titles, descriptions
  • Addresses, notes, comments
  • Any free-form text input
  • IDs, codes, references (when no special formatting needed)

Example

import type { IvtSchema } from '@ivandt/importer';

const schema: IvtSchema = {
  title: 'Contact Import',
  publicKey: 'pk_live_xxx',
  sessionToken: 'session_xxx',
  fields: [
    {
      type: 'text',
      label: 'Full Name',
      key: 'fullName',
      order: 0,
      validators: [
        { type: 'required' },
        { type: 'minLength', value: 2 }
      ]
    },
    {
      type: 'text',
      label: 'Company',
      key: 'company',
      order: 1,
      placeholder: 'Enter company name'
    },
    {
      type: 'text',
      label: 'Notes',
      key: 'notes',
      order: 2,
      columnWidth: 30,
      textEllipsis: true
    }
  ]
};

With Transformers

{
  type: 'text',
  label: 'Product Code',
  key: 'productCode',
  order: 0,
  transformers: [
    { action: 'trimWhitespace' },
    { action: 'toUpperCase' },
  ],
  validators: [
    { type: 'required' },
    { type: 'regex', pattern: '^[A-Z]{3}-\\d{4}$' }
  ]
}