form-rhf-array.tsx — ui Source File
Architecture documentation for form-rhf-array.tsx, a tsx file in the ui codebase. 10 imports, 0 dependents.
Entity Profile
Dependency Diagram
graph LR bf56a2ea_0934_35a9_97c8_707b9516af33["form-rhf-array.tsx"] 1d141819_425e_b5fd_4c8e_32f7c6a42cf2["react"] bf56a2ea_0934_35a9_97c8_707b9516af33 --> 1d141819_425e_b5fd_4c8e_32f7c6a42cf2 3d40a3bf_c062_4304_329a_00b1b72e8523["zod"] bf56a2ea_0934_35a9_97c8_707b9516af33 --> 3d40a3bf_c062_4304_329a_00b1b72e8523 d39cd1e4_1b2d_9aa2_1d29_fd0b4bfb61c3["lucide-react"] bf56a2ea_0934_35a9_97c8_707b9516af33 --> d39cd1e4_1b2d_9aa2_1d29_fd0b4bfb61c3 6d65354d_8f59_2cfc_4783_24b2eb870bc4["react-hook-form"] bf56a2ea_0934_35a9_97c8_707b9516af33 --> 6d65354d_8f59_2cfc_4783_24b2eb870bc4 e750d152_1191_1793_7244_99c7f9c595f4["sonner"] bf56a2ea_0934_35a9_97c8_707b9516af33 --> e750d152_1191_1793_7244_99c7f9c595f4 6802ce19_522d_e5fb_e458_8826d9f6952e["zod"] bf56a2ea_0934_35a9_97c8_707b9516af33 --> 6802ce19_522d_e5fb_e458_8826d9f6952e 57e86e45_ac6e_7278_be08_9092724e8401["button"] bf56a2ea_0934_35a9_97c8_707b9516af33 --> 57e86e45_ac6e_7278_be08_9092724e8401 c6d6139d_ea69_3d79_5004_68419bae2ac0["card"] bf56a2ea_0934_35a9_97c8_707b9516af33 --> c6d6139d_ea69_3d79_5004_68419bae2ac0 169af77a_46c3_8fec_4801_f34a0f1a3471["field"] bf56a2ea_0934_35a9_97c8_707b9516af33 --> 169af77a_46c3_8fec_4801_f34a0f1a3471 41df1c2c_a3b4_dc22_8bc9_310fe8b6ba9b["input-group"] bf56a2ea_0934_35a9_97c8_707b9516af33 --> 41df1c2c_a3b4_dc22_8bc9_310fe8b6ba9b style bf56a2ea_0934_35a9_97c8_707b9516af33 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
"use client"
import * as React from "react"
import { zodResolver } from "@hookform/resolvers/zod"
import { XIcon } from "lucide-react"
import { Controller, useFieldArray, useForm } from "react-hook-form"
import { toast } from "sonner"
import * as z from "zod"
import { Button } from "@/registry/new-york-v4/ui/button"
import {
Card,
CardContent,
CardDescription,
CardFooter,
CardHeader,
CardTitle,
} from "@/registry/new-york-v4/ui/card"
import {
Field,
FieldContent,
FieldDescription,
FieldError,
FieldGroup,
FieldLegend,
FieldSet,
} from "@/registry/new-york-v4/ui/field"
import {
InputGroup,
InputGroupAddon,
InputGroupButton,
InputGroupInput,
} from "@/registry/new-york-v4/ui/input-group"
const formSchema = z.object({
emails: z
.array(
z.object({
address: z.string().email("Enter a valid email address."),
})
)
.min(1, "Add at least one email address.")
.max(5, "You can add up to 5 email addresses."),
})
export default function FormRhfArray() {
const form = useForm<z.infer<typeof formSchema>>({
resolver: zodResolver(formSchema),
defaultValues: {
emails: [{ address: "" }, { address: "" }],
},
})
const { fields, append, remove } = useFieldArray({
control: form.control,
name: "emails",
})
function onSubmit(data: z.infer<typeof formSchema>) {
toast("You submitted the following values:", {
// ... (101 more lines)
Domain
Subdomains
Functions
Dependencies
- button
- card
- field
- input-group
- lucide-react
- react
- react-hook-form
- sonner
- zod
- zod
Source
Frequently Asked Questions
What does form-rhf-array.tsx do?
form-rhf-array.tsx is a source file in the ui codebase, written in tsx. It belongs to the ComponentRegistry domain, ChartRegistry subdomain.
What functions are defined in form-rhf-array.tsx?
form-rhf-array.tsx defines 1 function(s): FormRhfArray.
What does form-rhf-array.tsx depend on?
form-rhf-array.tsx imports 10 module(s): button, card, field, input-group, lucide-react, react, react-hook-form, sonner, and 2 more.
Where is form-rhf-array.tsx in the architecture?
form-rhf-array.tsx is located at apps/v4/registry/new-york-v4/examples/form-rhf-array.tsx (domain: ComponentRegistry, subdomain: ChartRegistry, directory: apps/v4/registry/new-york-v4/examples).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free