/web:tanstack-formfrom web
Builds type-safe, accessible forms with TanStack Form, Base UI Field, and the useAppForm hook. Use when creating forms, adding validation, handling form submission, or working with form fields and form state management.
Ships in web. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
TanStack Form with Base UI Field for accessible, type-safe forms. The useAppForm hook (from @/components/form) provides pre-configured form and field components integrated with shadcn's Button and Label.
useAppForm — never raw TanStack Form hooksvalidators.onSubmitfield.Control with render prop to bind UI componentsfield.Root, field.Label, field.Control, and field.ErrorMessagerender prop on DialogContent — see Forms in Dialogsimport { z } from "zod";
import { useAppForm } from "@/components/form";
| Component | Use |
|---|---|
form.Root | Wrapper — provides form context, handles submit |
form.AppField | Creates a field with access to field sub-components |
form.Submit | Submit button — auto-disables when pristine/invalid/submitting |
form.Subscribe | Subscribe to form state for custom rendering |
All components available inside form.AppField render callback:
| Component | Use |
|---|---|
field.Root | Wraps field, connects aria-invalid and aria-describedby |
field.Label | Label — auto-connects to input via for/id |
field.Control | Input wrapper — handles value/onChange binding |
field.ErrorMessage | Shows validation errors |
render prop customizes the underlying element while keeping form state binding:
<field.Root render={<InputGroup.Root />}>
<field.Control render={<InputGroup.Input placeholder="Email" />} />
</field.Root>
| API | Use |
|---|---|
form.reset() | Reset to default values |
form.setFieldValue("name", value) | Set field value |
form.state.values | Get current values |
form.validate() | Trigger validation |
When a form lives inside a DialogContent or AlertDialogContent, use the render prop to make the dialog content render as the form. This ensures fields and footer inherit the dialog's grid layout (gap-6) instead of being nested inside a separate form element.
// Correct — DialogContent renders as the form
<DialogContent render={<form.Root form={form} />}>
<DialogHeader>
<DialogTitle>Add Item</DialogTitle>
</DialogHeader>
<FieldGroup>
<form.AppField name="name">
{(field) => (
<field.Root>
<field.Label>Name</field.Label>
<field.Control render={<Input />} />
<field.ErrorMessage />
</field.Root>
)}
</form.AppField>
</FieldGroup>
<DialogFooter>
<form.Submit>Create</form.Submit>
</DialogFooter>
</DialogContent>
// Wrong — form.Root nested inside DialogContent breaks grid spacing
<DialogContent>
<form.Root form={form}>
...
</form.Root>
</DialogContent>
If the render prop is not viable (e.g. the form is a child of a non-polymorphic container), use className="contents" on form.Root so it doesn't generate its own CSS box and children participate directly in the parent's grid.
Forms inside Dialogs must call form.reset() when the container closes. This prevents stale data and validation errors from persisting if the user reopens the modal.
form.reset() in the onOpenChange callback of the Dialogform.reset() in the onSubmit handler after the async operation succeedsconst form = useAppForm({
defaultValues: { name: "" },
validators: { onSubmit: schema },
onSubmit: async ({ value }) => {
await createItem(value);
form.reset();
setOpen(false);
},
});
<Dialog
open={open}
onOpenChange={(isOpen) => {
if (!isOpen) form.reset();
setOpen(isOpen);
}}
>
<DialogContent render={<form.Root form={form} />}>
...
</DialogContent>
</Dialog>
Do NOT reset forms that persist on the page (e.g. settings cards, inline edit forms) — reset only applies when the form's container is unmounted or hidden.
Base UI Field automatically handles — no manual wiring needed:
aria-invalid on invalid fieldsaria-describedby linking inputs to error messagesfor/id linking labels to inputsSee examples/ for complete form examples by pattern:
| Example | When to use |
|---|---|
examples/basic-form.md | Simple form with validation and submission |
examples/polymorphic-fields.md | Custom UI components with render prop |
useAppForm from @/components/formvalidators.onSubmitRoot, Label, Control, ErrorMessageform.Root as wrapper, form.Submit for submit buttonrender prop, not manual bindingrender={<form.Root />} on DialogContent/AlertDialogContentform.reset() on close via onOpenChangeWhat SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub kvnwolf/devtools --plugin webOther plugins' skills for the same job
7 skills in this plugin
/agent-browserBrowser automation CLI for AI agents. Use when the user needs to interact with websites, including navigating pages, filling forms, clicking buttons, taking screenshots, extracting data, testing web apps, or automating any browser task. Triggers include requests to "open a website", "fill out a form", "click a button", "take a screenshot", "scrape data from a page", "test this web app", "login to a site", "automate browser actions", or any task requiring programmatic web interaction./component-testingWrites component tests using Vitest Browser Mode with Playwright for real-browser testing. Use when testing React components, writing browser-based tests, verifying UI behavior, testing forms, or deciding whether a component needs a test./