UI / Components / foundations / Form

Form

Validation patterns + async submit.

Form wrapper that handles async submit + inline error display + disable-while-pending. Use with Label + Input + Button to assemble any small form quickly.

$npx dock-ui add form

Usage

import { Form } from "@/components/ui/form";

<Form onSubmit={async (data) => save(data)}>
  <Label htmlFor="name" required>Name</Label>
  <Input id="name" name="name" />
  <Button type="submit">Save</Button>
</Form>

Install

via CLI
$ npx dock-ui add form
Writes the file(s) directly to your components/ui/ folder. You own the code.
For agents
curl -L https://ui.trydock.ai/r/form.json
Returns a JSON manifest with file paths + contents. Agent-readable, LLM-fetchable.
← All components
Themes·Component kit · glossary
View on GitHub →