FormTanstackInput() — ui Function Reference
Architecture documentation for the FormTanstackInput() function in form-tanstack-input.tsx from the ui codebase.
Entity Profile
Dependency Diagram
graph TD dca7b6a4_3c8d_e6b7_de91_a552133651ed["FormTanstackInput()"] 7e69ebed_98e4_a09b_b28e_1801c7683c88["form-tanstack-input.tsx"] dca7b6a4_3c8d_e6b7_de91_a552133651ed -->|defined in| 7e69ebed_98e4_a09b_b28e_1801c7683c88 style dca7b6a4_3c8d_e6b7_de91_a552133651ed fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
apps/v4/registry/new-york-v4/examples/form-tanstack-input.tsx lines 37–127
export default function FormTanstackInput() {
const form = useForm({
defaultValues: {
username: "",
},
validators: {
onSubmit: formSchema,
},
onSubmit: async ({ value }) => {
toast("You submitted the following values:", {
description: (
<pre className="bg-code text-code-foreground mt-2 w-[320px] overflow-x-auto rounded-md p-4">
<code>{JSON.stringify(value, null, 2)}</code>
</pre>
),
position: "bottom-right",
classNames: {
content: "flex flex-col gap-2",
},
style: {
"--border-radius": "calc(var(--radius) + 4px)",
} as React.CSSProperties,
})
},
})
return (
<Card className="w-full sm:max-w-md">
<CardHeader>
<CardTitle>Profile Settings</CardTitle>
<CardDescription>
Update your profile information below.
</CardDescription>
</CardHeader>
<CardContent>
<form
id="form-tanstack-input"
onSubmit={(e) => {
e.preventDefault()
form.handleSubmit()
}}
>
<FieldGroup>
<form.Field
name="username"
children={(field) => {
const isInvalid =
field.state.meta.isTouched && !field.state.meta.isValid
return (
<Field data-invalid={isInvalid}>
<FieldLabel htmlFor="form-tanstack-input-username">
Username
</FieldLabel>
<Input
id="form-tanstack-input-username"
name={field.name}
value={field.state.value}
onBlur={field.handleBlur}
onChange={(e) => field.handleChange(e.target.value)}
aria-invalid={isInvalid}
placeholder="shadcn"
autoComplete="username"
/>
<FieldDescription>
This is your public display name. Must be between 3 and 10
characters. Must only contain letters, numbers, and
underscores.
</FieldDescription>
{isInvalid && (
<FieldError errors={field.state.meta.errors} />
)}
</Field>
)
}}
/>
</FieldGroup>
</form>
</CardContent>
<CardFooter>
<Field orientation="horizontal">
<Button type="button" variant="outline" onClick={() => form.reset()}>
Domain
Subdomains
Source
Frequently Asked Questions
What does FormTanstackInput() do?
FormTanstackInput() is a function in the ui codebase, defined in apps/v4/registry/new-york-v4/examples/form-tanstack-input.tsx.
Where is FormTanstackInput() defined?
FormTanstackInput() is defined in apps/v4/registry/new-york-v4/examples/form-tanstack-input.tsx at line 37.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free