---
title: "Form"
description: "The submit lifecycle and field binding behind every edbn form: server errors beside their fields, one submit at a time, focus on the first problem, drafts, availability checks, and resend cooldowns."
plan: Pro
docs: https://ui.edbn.me/docs/forms/form-core
example: submit
---

# Form

The submit lifecycle and field binding behind every edbn form: server errors beside their fields, one submit at a time, focus on the first problem, drafts, availability checks, and resend cooldowns.

## Installation

This is a Pro item. Once per project, create a token at https://ui.edbn.me/dashboard/tokens, put it in `.env.local` as `EDBN_TOKEN`, and add the registry to `components.json`:

```json
{
  "registries": {
    "@edbn": {
      "url": "https://ui.edbn.me/r/{name}.json",
      "headers": { "Authorization": "Bearer ${EDBN_TOKEN}" }
    }
  }
}
```

Then install:

```bash
npx shadcn@4.19.0 add @edbn/form-core
```

## Dependencies
- npm: react-hook-form@^7.87.0, @hookform/resolvers@^5.9.1, zod@^4.3.5, lucide-react@^1.33.0
- edbn: edbn-base, field, button, spinner, alert

## Usage: Submit

The example code is part of Pro (https://ui.edbn.me/pricing). With the user's token, the edbn MCP server's `get_example` tool returns it: https://ui.edbn.me/mcp

## Examples
- [Submit](https://ui.edbn.me/docs/forms/form-core/submit) (Markdown: https://ui.edbn.me/docs/forms/form-core.md?demo=submit)
- [Error summary](https://ui.edbn.me/docs/forms/form-core/error-summary) (Markdown: https://ui.edbn.me/docs/forms/form-core.md?demo=error-summary)
- [Availability check](https://ui.edbn.me/docs/forms/form-core/async-validation) (Markdown: https://ui.edbn.me/docs/forms/form-core.md?demo=async-validation)
- [Drafts](https://ui.edbn.me/docs/forms/form-core/draft) (Markdown: https://ui.edbn.me/docs/forms/form-core.md?demo=draft)

## Files
- components/forms/core/form.tsx (316 lines)
- components/forms/core/form-field.tsx (288 lines)
- components/forms/core/form-submit.tsx (60 lines)
- components/forms/core/form-error-summary.tsx (63 lines)
- components/forms/core/resend-button.tsx (89 lines)
- components/forms/core/form-result.ts (65 lines)
- components/forms/core/server.ts (30 lines)
- components/forms/core/use-unsaved-changes.ts (70 lines)
- components/forms/core/use-form-draft.ts (185 lines)
- components/forms/core/use-async-validation.ts (106 lines)

## For agents
- Base theme, once per project: npx shadcn@4.19.0 add https://ui.edbn.me/r/edbn-base.json
- MCP server with search, items, examples and source: https://ui.edbn.me/mcp
- Every page and item: https://ui.edbn.me/llms.txt
