# AdaptableForm

Canonical page: https://www.adaptabletools.com/docs/reference/adaptableform

Defines a form which appears dynamically; used by Alerts, Export Custom
Destinations and Dashboard Custom Toolbars.

```ts title="TypeScript"
export interface AdaptableForm<T extends BaseContext, TData extends AdaptableFormData = AdaptableFormData> 
```

## Properties

| Property | Type | Description | Default |
| --- | --- | --- | --- |
| [buttons](https://www.adaptabletools.com/docs/reference/adaptableform.md#buttons) | [`AdaptableButton`](https://www.adaptabletools.com/docs/reference/adaptablebutton.md)`<T>[]` | Buttons to include in the Form |   |
| [description](https://www.adaptabletools.com/docs/reference/adaptableform.md#description) | `string` | Additional information to appear in the Form |   |
| [fields](https://www.adaptabletools.com/docs/reference/adaptableform.md#fields) | `(`[`AdaptableFormField`](https://www.adaptabletools.com/docs/reference/adaptableformfield.md)` \| `[`AdaptableFormField`](https://www.adaptabletools.com/docs/reference/adaptableformfield.md)`[] \| `[`AdaptableFormFieldGroup`](https://www.adaptabletools.com/docs/reference/adaptableformfieldgroup.md)`)[]` | Collection of Dynamic Fields and Field Groups to display.<br/><br/>Items can be:<br/>- a single  (rendered on its own row in the<br/> default `rows` layout, or as one cell in the `inline` layout),<br/>- an array of  (rendered side-by-side on the<br/> same row in the `rows` layout), or<br/>- an  (a labelled section that<br/> visually groups related fields). |   |
| [layout](https://www.adaptabletools.com/docs/reference/adaptableform.md#layout) | [`AdaptableFormLayout`](https://www.adaptabletools.com/docs/reference/adaptableformlayout.md) | How the form&#39;s fields are arranged on screen.<br/><br/>- `rows` (default): each field on its own row, label on the left and<br/> input on the right. Suitable for popups / wizards.<br/>- `inline`: fields are placed side-by-side on a single horizontal line,<br/> with the label rendered immediately before its input. Designed for<br/> compact contexts such as Dashboard Custom Toolbars where vertical<br/> real-estate is scarce. | &#39;rows&#39; |
| [onSubmit](https://www.adaptabletools.com/docs/reference/adaptableform.md#onsubmit) | `(formData: TData, context: T) => void` | Optional form-level submit hook.<br/><br/>Fired when the user presses `Enter` while focus is inside any field<br/>input AND the form is currently valid. The full `formData` is passed<br/>through, typed as `TData` if you&#39;ve supplied a custom shape.<br/><br/>Use this as an ergonomic shortcut to avoid wiring an explicit &quot;Submit&quot;<br/>button - or in addition to one, so power users can press Enter to<br/>commit. If the form is invalid the hook is not invoked. |   |
| [title](https://www.adaptabletools.com/docs/reference/adaptableform.md#title) | `string` | Title to appear in the Form |   |

## Property Details

### buttons

Buttons to include in the Form

```ts title="TypeScript"
buttons?: AdaptableButton<T>[];
```

###### Property Value

[`AdaptableButton`](https://www.adaptabletools.com/docs/reference/adaptablebutton.md)`<T>[]`

### description

Additional information to appear in the Form

```ts title="TypeScript"
description?: string;
```

###### Property Value

`string`

### fields

Collection of Dynamic Fields and Field Groups to display.

Items can be:
- a single  (rendered on its own row in the
 default `rows` layout, or as one cell in the `inline` layout),
- an array of  (rendered side-by-side on the
 same row in the `rows` layout), or
- an  (a labelled section that
 visually groups related fields).

```ts title="TypeScript"
fields?: (AdaptableFormField | AdaptableFormField[] | AdaptableFormFieldGroup)[];
```

###### Property Value

`(`[`AdaptableFormField`](https://www.adaptabletools.com/docs/reference/adaptableformfield.md)` | `[`AdaptableFormField`](https://www.adaptabletools.com/docs/reference/adaptableformfield.md)`[] | `[`AdaptableFormFieldGroup`](https://www.adaptabletools.com/docs/reference/adaptableformfieldgroup.md)`)[]`

### layout

How the form&#39;s fields are arranged on screen.

- `rows` (default): each field on its own row, label on the left and
 input on the right. Suitable for popups / wizards.
- `inline`: fields are placed side-by-side on a single horizontal line,
 with the label rendered immediately before its input. Designed for
 compact contexts such as Dashboard Custom Toolbars where vertical
 real-estate is scarce.

```ts title="TypeScript"
layout?: AdaptableFormLayout;
```

###### Default Value

&#39;rows&#39;

###### Property Value

[`AdaptableFormLayout`](https://www.adaptabletools.com/docs/reference/adaptableformlayout.md)

### onSubmit

Optional form-level submit hook.

Fired when the user presses `Enter` while focus is inside any field
input AND the form is currently valid. The full `formData` is passed
through, typed as `TData` if you&#39;ve supplied a custom shape.

Use this as an ergonomic shortcut to avoid wiring an explicit &quot;Submit&quot;
button - or in addition to one, so power users can press Enter to
commit. If the form is invalid the hook is not invoked.

```ts title="TypeScript"
onSubmit?: (formData: TData, context: T) => void;
```

###### Property Value

`(formData: TData, context: T) => void`

### title

Title to appear in the Form

```ts title="TypeScript"
title?: string;
```

###### Property Value

`string`
