> ## Documentation Index
> Fetch the complete documentation index at: https://botmesh.afaya.com.co/llms.txt
> Use this file to discover all available pages before exploring further.

# OptInFormField

> Interface exported by @botmesh/core.

Defined in: [forms/types.ts:132](https://github.com/andresayac/botmesh/blob/main/packages/core/src/forms/types.ts#L132)

A consent checkbox (`c.state` gets a `boolean`). When `required`, the user must
accept it to submit the form.

## Extends

* [`FormFieldBase`](https://botmesh.afaya.com.co/api/core/interfaces/FormFieldBase)

## Properties

### name

```ts theme={null}
name: string;
```

Defined in: [forms/types.ts:38](https://github.com/andresayac/botmesh/blob/main/packages/core/src/forms/types.ts#L38)

Key of the answer in the form's values (and in `c.state` with `flatten`).
Letters, digits and `_`, starting with a letter or `_` (`/^[A-Za-z_][A-Za-z0-9_]*$/`).

#### Inherited from

[`FormFieldBase`](https://botmesh.afaya.com.co/api/core/interfaces/FormFieldBase).[`name`](https://botmesh.afaya.com.co/api/core/interfaces/FormFieldBase#name)

***

### label

```ts theme={null}
label: string;
```

Defined in: [forms/types.ts:40](https://github.com/andresayac/botmesh/blob/main/packages/core/src/forms/types.ts#L40)

Short label shown next to the input (native) or used as the question (degraded).

#### Inherited from

[`FormFieldBase`](https://botmesh.afaya.com.co/api/core/interfaces/FormFieldBase).[`label`](https://botmesh.afaya.com.co/api/core/interfaces/FormFieldBase#label)

***

### required?

```ts theme={null}
required?: boolean;
```

Defined in: [forms/types.ts:42](https://github.com/andresayac/botmesh/blob/main/packages/core/src/forms/types.ts#L42)

Whether an answer is mandatory. Default `true` (`false` for `optin`).

#### Inherited from

[`FormFieldBase`](https://botmesh.afaya.com.co/api/core/interfaces/FormFieldBase).[`required`](https://botmesh.afaya.com.co/api/core/interfaces/FormFieldBase#required)

***

### helper?

```ts theme={null}
helper?: string;
```

Defined in: [forms/types.ts:44](https://github.com/andresayac/botmesh/blob/main/packages/core/src/forms/types.ts#L44)

Extra hint under the input (native) / appended to the question (degraded).

#### Inherited from

[`FormFieldBase`](https://botmesh.afaya.com.co/api/core/interfaces/FormFieldBase).[`helper`](https://botmesh.afaya.com.co/api/core/interfaces/FormFieldBase#helper)

***

### prompt?

```ts theme={null}
prompt?: string;
```

Defined in: [forms/types.ts:46](https://github.com/andresayac/botmesh/blob/main/packages/core/src/forms/types.ts#L46)

Degraded mode only: full question text instead of `label` (+ `helper`).

#### Inherited from

[`FormFieldBase`](https://botmesh.afaya.com.co/api/core/interfaces/FormFieldBase).[`prompt`](https://botmesh.afaya.com.co/api/core/interfaces/FormFieldBase#prompt)

***

### error?

```ts theme={null}
error?: string;
```

Defined in: [forms/types.ts:48](https://github.com/andresayac/botmesh/blob/main/packages/core/src/forms/types.ts#L48)

Error message used when an answer for this field is invalid (overrides the built-in ones).

#### Inherited from

[`FormFieldBase`](https://botmesh.afaya.com.co/api/core/interfaces/FormFieldBase).[`error`](https://botmesh.afaya.com.co/api/core/interfaces/FormFieldBase#error)

***

### type

```ts theme={null}
type: "optin";
```

Defined in: [forms/types.ts:133](https://github.com/andresayac/botmesh/blob/main/packages/core/src/forms/types.ts#L133)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.