radio-group-form.tsx — ui Source File
Architecture documentation for radio-group-form.tsx, a tsx file in the ui codebase. 7 imports, 0 dependents.
Entity Profile
Dependency Diagram
graph LR 45041995_803a_a7f0_adee_e2b20b8c7025["radio-group-form.tsx"] 3d40a3bf_c062_4304_329a_00b1b72e8523["zod"] 45041995_803a_a7f0_adee_e2b20b8c7025 --> 3d40a3bf_c062_4304_329a_00b1b72e8523 6d65354d_8f59_2cfc_4783_24b2eb870bc4["react-hook-form"] 45041995_803a_a7f0_adee_e2b20b8c7025 --> 6d65354d_8f59_2cfc_4783_24b2eb870bc4 6802ce19_522d_e5fb_e458_8826d9f6952e["zod"] 45041995_803a_a7f0_adee_e2b20b8c7025 --> 6802ce19_522d_e5fb_e458_8826d9f6952e 1d9c6c27_a443_c5fd_35f3_e80b7125bc9f["use-toast"] 45041995_803a_a7f0_adee_e2b20b8c7025 --> 1d9c6c27_a443_c5fd_35f3_e80b7125bc9f d418ad18_b947_f4e5_6e4c_01100d7a63e4["button"] 45041995_803a_a7f0_adee_e2b20b8c7025 --> d418ad18_b947_f4e5_6e4c_01100d7a63e4 2f59b429_1e60_57e1_0581_cc5440e0bd30["form"] 45041995_803a_a7f0_adee_e2b20b8c7025 --> 2f59b429_1e60_57e1_0581_cc5440e0bd30 dcf2e363_f0c9_b040_9d55_bfa0d2402262["radio-group"] 45041995_803a_a7f0_adee_e2b20b8c7025 --> dcf2e363_f0c9_b040_9d55_bfa0d2402262 style 45041995_803a_a7f0_adee_e2b20b8c7025 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
"use client"
import { zodResolver } from "@hookform/resolvers/zod"
import { useForm } from "react-hook-form"
import { z } from "zod"
import { toast } from "@/registry/default/hooks/use-toast"
import { Button } from "@/registry/default/ui/button"
import {
Form,
FormControl,
FormField,
FormItem,
FormLabel,
FormMessage,
} from "@/registry/default/ui/form"
import { RadioGroup, RadioGroupItem } from "@/registry/default/ui/radio-group"
const FormSchema = z.object({
type: z.enum(["all", "mentions", "none"], {
required_error: "You need to select a notification type.",
}),
})
export default function RadioGroupForm() {
const form = useForm<z.infer<typeof FormSchema>>({
resolver: zodResolver(FormSchema),
})
function onSubmit(data: z.infer<typeof FormSchema>) {
toast({
title: "You submitted the following values:",
description: (
<pre className="mt-2 w-[340px] rounded-md bg-slate-950 p-4">
<code className="text-white">{JSON.stringify(data, null, 2)}</code>
</pre>
),
})
}
return (
<Form {...form}>
<form onSubmit={form.handleSubmit(onSubmit)} className="w-2/3 space-y-6">
<FormField
control={form.control}
name="type"
render={({ field }) => (
<FormItem className="space-y-3">
<FormLabel>Notify me about...</FormLabel>
<FormControl>
<RadioGroup
onValueChange={field.onChange}
defaultValue={field.value}
className="flex flex-col space-y-1"
>
<FormItem className="flex items-center space-x-3 space-y-0">
<FormControl>
<RadioGroupItem value="all" />
</FormControl>
<FormLabel className="font-normal">
All new messages
</FormLabel>
</FormItem>
<FormItem className="flex items-center space-x-3 space-y-0">
<FormControl>
<RadioGroupItem value="mentions" />
</FormControl>
<FormLabel className="font-normal">
Direct messages and mentions
</FormLabel>
</FormItem>
<FormItem className="flex items-center space-x-3 space-y-0">
<FormControl>
<RadioGroupItem value="none" />
</FormControl>
<FormLabel className="font-normal">Nothing</FormLabel>
</FormItem>
</RadioGroup>
</FormControl>
<FormMessage />
</FormItem>
)}
/>
<Button type="submit">Submit</Button>
</form>
</Form>
)
}
Domain
Subdomains
Functions
Dependencies
- button
- form
- radio-group
- react-hook-form
- use-toast
- zod
- zod
Source
Frequently Asked Questions
What does radio-group-form.tsx do?
radio-group-form.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 radio-group-form.tsx?
radio-group-form.tsx defines 1 function(s): RadioGroupForm.
What does radio-group-form.tsx depend on?
radio-group-form.tsx imports 7 module(s): button, form, radio-group, react-hook-form, use-toast, zod, zod.
Where is radio-group-form.tsx in the architecture?
radio-group-form.tsx is located at deprecated/www/registry/default/examples/radio-group-form.tsx (domain: ComponentRegistry, subdomain: ChartRegistry, directory: deprecated/www/registry/default/examples).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free