# createForm API

> Auto-generated API reference for `createForm` from @vuetify/v0 (Vuetify0).
> Source of truth: https://0.vuetifyjs.com/api/create-form

## Related

- https://0.vuetifyjs.com/composables/forms/create-form
- https://0.vuetifyjs.com/components/forms/form
- https://0.vuetifyjs.com/composables/forms/create-input
- https://0.vuetifyjs.com/composables/forms/create-validation
- https://0.vuetifyjs.com/composables/plugins/use-rules
- https://0.vuetifyjs.com/composables/registration/create-registry

## Functions

### createForm

Creates a new form instance.

A form is a pure registry of validation contexts. Validations register
themselves via `useForm()` injection. The form coordinates submit, reset,
and aggregate state across all registered validations.

```ts
(_options?: FormOptions) => FormContext<FormTicketInput, FormTicket<FormTicketInput>>
```

### createFormContext

Creates a new form context using the Trinity pattern.

```ts
(_options?: FormContextOptions) => ContextTrinity<FormContext<FormTicketInput, FormTicket<FormTicketInput>>>
```

### useForm

Returns the current form instance.

```ts
(namespace?: string) => R | undefined
```

## Options

| Name | Type | Default | Required | Description |
|---|---|---|---|---|
| `events` | `boolean \| undefined` | `false` | no | Enable event emission for registry operations |
| `reactive` | `boolean \| undefined` | `false` | no | Enable reactive behavior for registry operations |
| `disabled` | `MaybeRefOrGetter<boolean> \| undefined` | — | no | Whether the form starts disabled. |
| `readonly` | `MaybeRefOrGetter<boolean> \| undefined` | — | no | Whether the form starts readonly. |

## Methods

| Name | Type | Description |
|---|---|---|
| `clear` | `() => void` | Clear the entire registry |
| `has` | `(id: ID) => boolean` | Check if a ticket exists by ID |
| `keys` | `() => readonly ID[]` | Get all registered IDs |
| `browse` | `(value: E["value"]) => readonly ID[] \| undefined` | Browse for an ID(s) by value |
| `lookup` | `(index: number) => ID \| undefined` | Lookup a ticket by index number |
| `get` | `(id: ID) => E \| undefined` | Get a ticket by ID |
| `upsert` | `(id: ID, ticket?: Partial<Z>, event?: string) => E` | Update or insert a ticket by ID |
| `values` | `() => readonly E[]` | Get all values of registered tickets |
| `entries` | `() => readonly [ID, E][]` | Get all entries of registered tickets |
| `unregister` | `(id: ID) => void` | Unregister a ticket by ID |
| `reindex` | `() => void` | Reset the index directory and update all tickets |
| `move` | `(id: ID, toIndex: number) => E \| undefined` | Move a ticket to a new index position |
| `reorder` | `(ids: ID[]) => void` | Reorder the registry to match a canonical permutation of ids in one pass. |
| `seek` | `(direction?: "first" \| "last", from?: number, predicate?: (ticket: E) => boolean) => E \| undefined` | Seek for a ticket based on direction and optional predicate |
| `on` | `<K extends Extensible<RegistryEventName>>(event: K, cb: RegistryEventCallback<E, K>) => void` | Listen for registry events |
| `off` | `<K extends Extensible<RegistryEventName>>(event: K, cb: RegistryEventCallback<E, K>) => void` | Stop listening for registry events |
| `emit` | `<K extends Extensible<RegistryEventName>>(event: K, data: EventPayload<E, K>) => void` | Emit an event with data |
| `dispose` | `() => void` | Clears the registry and removes all listeners |
| `offboard` | `(ids: ID[]) => Partial<Z>[]` | Offboard multiple tickets at once, returning the input shapes that were removed. |
| `batch` | `<R>(fn: () => R) => R` | Execute operations in a batch, deferring cache invalidation and event emission until complete |
| `register` | `(registration: Partial<Z> & { value: FormValue; }) => E` | Register a validation context with the form. |
| `submit` | `(id?: ID \| ID[]) => Promise<boolean>` | Submit: validate specific fields or all. |
| `reset` | `() => void` | Reset all registered validations. |

## Properties

| Name | Type | Description |
|---|---|---|
| `collection` | `ReadonlyMap<ID, E>` | The collection of tickets in the registry |
| `size` | `number` | The number of tickets in the registry |
| `disabled` | `MaybeRefOrGetter<boolean>` | Whether the form is disabled. Components can read this to conditionally disable inputs. |
| `readonly` | `MaybeRefOrGetter<boolean>` | Whether the form is readonly. Components can read this to conditionally disable inputs. |
| `isValid` | `ComputedRef<boolean \| null>` | Aggregate: true if all validations valid, false if any invalid, null if any unvalidated. |
| `isValidating` | `ComputedRef<boolean>` | Aggregate: true if any validation is in progress. |
