> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lyzn.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Form

> Container for form inputs and submission

# Form

The `Form` component wraps input fields and handles data submission.

## Usage

```jsx theme={null}
<Form onSubmit={{ type: "api.post", payload: { endpoint: "/users" } }}>
  <Input name="name" label="Name" />
  <Input name="email" label="Email" />
  <Button type="submit" label="Submit" />
</Form>
```

## Props

<ResponseField name="onSubmit" type="object">
  Action object to execute when form is valid and submitted.
</ResponseField>

<ResponseField name="defaultValues" type="object">
  Initial values for fields.
</ResponseField>

<ResponseField name="gap" type="string" default="md">
  Spacing between form fields.
</ResponseField>

## Examples

### Profile Update

```jsx theme={null}
<Form 
  defaultValues={{ name: user.name, bio: user.bio }}
  onSubmit={{ type: "updateProfile" }}
>
  <Input name="name" label="Name" required />
  <Textarea name="bio" label="Bio" />
  <Button label="Save Changes" />
</Form>
```
