# Types: FormFieldType to StoreFormCopy (/themes/sdk/reference/forms/types-1)

```ts
import { … } from '@poltura/theme-sdk/forms';
```

## `FormFieldType` [#formfieldtype]

What a form field asks for, which decides the control it draws.

```ts
type FormFieldType = 'text' | 'email' | 'tel' | 'textarea' | 'select' | 'radio' | 'checkbox' | 'multiselect' | 'number' | 'date' | 'file'
```

## `FormFieldOption` [#formfieldoption]

One choice of a select, radio or multi-select field.

<TypeTable type={{"value":{"description":"The value the submission stores.","type":"string","required":true},"label":{"description":"The choice as the shopper reads it, in the page language.","type":"string","required":true}}} />

## `StoreFormFieldView` [#storeformfieldview]

A field of a published form, already in the page language.

<TypeTable type={{"id":{"description":"The field's id; submissions and `copy.labels` key on it.","type":"string","required":true},"type":{"description":"What the field asks for.","type":"FormFieldType","required":true},"label":{"description":"The field's label.","type":"string","required":true},"placeholder":{"description":"The placeholder, or null.","type":"string | null","required":true},"helpText":{"description":"The help line under the control, or null.","type":"string | null","required":true},"required":{"description":"Whether the form refuses to submit without it.","type":"boolean","required":true},"options":{"description":"The choices of a select, radio or multi-select field; empty otherwise.","type":"readonly FormFieldOption[]","required":true},"min":{"description":"The lowest number a number field takes, or null.","type":"number | null","required":true},"max":{"description":"The highest number a number field takes, or null.","type":"number | null","required":true},"step":{"description":"The step of a number field, or null.","type":"number | null","required":true},"accept":{"description":"The extensions and MIME types a file field takes, for a file input's `accept`; empty otherwise.","type":"readonly string[]","required":true},"maxFiles":{"description":"How many files a file field takes, or null for one.","type":"number | null","required":true},"maxBytes":{"description":"The largest file a file field takes, in bytes, or null.","type":"number | null","required":true}}} />

## `FormValue` [#formvalue]

The value of one field: text, a number, a ticked box or the picked choices.

```ts
type FormValue = string | number | boolean | string[]
```

## `StoreFormStatus` [#storeformstatus]

Where a form is in its life: loading, ready to fill in, missing, or sent.

```ts
type StoreFormStatus = 'loading' | 'ready' | 'unavailable' | 'success'
```

## `StoreFormFile` [#storeformfile]

A file the shopper picked for a file field.

<TypeTable type={{"localId":{"description":"The file's id in this form, for removing it.","type":"string","required":true},"filename":{"description":"The file name.","type":"string","required":true},"byteSize":{"description":"The file size in bytes.","type":"number","required":true},"mimeType":{"description":"The file's MIME type.","type":"string","required":true},"uploading":{"description":"Whether it is still uploading.","type":"boolean","required":true},"error":{"description":"Why the file was refused, or null.","type":"string | null","required":true}}} />

## `StoreFormTexts` [#storeformtexts]

The fixed wording of a form's buttons, in the page language.

<TypeTable type={{"submit":{"description":"The send button.","type":"string","required":true},"submitting":{"description":"The send button while the form is sending.","type":"string","required":true},"next":{"description":"The button to the next step.","type":"string","required":true},"back":{"description":"The button back to the previous step.","type":"string","required":true}}} />

## `StoreFormState` [#storeformstate]

A published form with its values, errors and the actions that fill it in and send it.

<TypeTable type={{"handle":{"description":"The form's handle.","type":"string","required":true},"title":{"description":"The form's title.","type":"string","required":true},"description":{"description":"The line under the title.","type":"string","required":true},"status":{"description":"Where the form is in its life.","type":"StoreFormStatus","required":true},"preview":{"description":"Whether the form runs in the customizer, where sending stores nothing.","type":"boolean","required":true},"submitting":{"description":"Whether the form is sending.","type":"boolean","required":true},"values":{"description":"The current values by field id.","type":"Readonly<Record<string, FormValue>>","required":true},"errors":{"description":"The error of each field that has one, by field id.","type":"Readonly<Record<string, string>>","required":true},"formError":{"description":"An error about the whole form, or null.","type":"string | null","required":true},"step":{"description":"The current step, from 0.","type":"number","required":true},"stepCount":{"description":"How many steps the form has; 1 for a single page.","type":"number","required":true},"fields":{"description":"The fields of the current step the shopper sees, in order.","type":"readonly StoreFormFieldView[]","required":true},"files":{"description":"The picked files of each file field, by field id.","type":"Readonly<Record<string, readonly StoreFormFile[]>>","required":true},"texts":{"description":"The wording of the form's buttons.","type":"StoreFormTexts","required":true},"setValue":{"description":"Sets one field's value.","type":"(fieldId: string, value: FormValue) => void","required":true},"uploadFiles":{"description":"Uploads files for a file field.","type":"(fieldId: string, files: File[]) => Promise<void>","required":true},"removeFile":{"description":"Removes a picked file.","type":"(fieldId: string, localId: string) => void","required":true},"submit":{"description":"Validates and sends the form.","type":"() => Promise<void>","required":true},"next":{"description":"Moves to the next step after checking the current one.","type":"() => void","required":true},"back":{"description":"Moves back a step.","type":"() => void","required":true},"reset":{"description":"Shows the empty form again after it was sent.","type":"() => void","required":true}}} />

## `StoreFormFieldState` [#storeformfieldstate]

One field of the surrounding form, with its value and error.

<TypeTable type={{"field":{"description":"The field, or null when the form has no field with that id.","type":"StoreFormFieldView | null","required":true},"value":{"description":"The field's value, or null before the form loaded.","type":"FormValue | null","required":true},"error":{"description":"The field's error, or null.","type":"string | null","required":true},"visible":{"description":"Whether the shopper sees the field; conditions can hide it.","type":"boolean","required":true},"setValue":{"description":"Sets the field's value.","type":"(value: FormValue) => void","required":true}}} />

## `StoreFormLayout` [#storeformlayout]

How a form's fields sit: one under another, or two per row on wide screens.

```ts
type StoreFormLayout = 'stacked' | 'compact'
```

## `StoreFormAppearance` [#storeformappearance]

The surface a form draws on.

```ts
type StoreFormAppearance = 'default' | 'muted' | 'outline' | 'inverse'
```

## `StoreFormChrome` [#storeformchrome]

Whether a form draws its title, description and card, or only its fields.

```ts
type StoreFormChrome = 'full' | 'fields'
```

## `StoreFormCopy` [#storeformcopy]

The theme's own wording for a form; empty values keep the merchant's.

<TypeTable type={{"title":{"description":"The title.","type":"string","required":false},"description":{"description":"The line under the title.","type":"string","required":false},"submitLabel":{"description":"The send button.","type":"string","required":false},"successTitle":{"description":"The heading after sending.","type":"string","required":false},"successMessage":{"description":"The message after sending.","type":"string","required":false},"newSubmissionLabel":{"description":"The button that shows the empty form again.","type":"string","required":false},"labels":{"description":"Field labels by field id.","type":"Readonly<Record<string, string>>","required":false},"placeholders":{"description":"Field placeholders by field id.","type":"Readonly<Record<string, string>>","required":false}}} />
