BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/formscn/contact-form

contact-form

formscn/contact-form
FreeBlock

Contact form with name, email, subject, and message

Install it

npx shadcn@latest add https://formscn.space/r/contact-form.json

Source

src/registry/default/templates/contact-form.tsxformscn.space/r/contact-form.json
1"use client";
2
3import { useForm } from "react-hook-form";
4import { zodResolver } from "@hookform/resolvers/zod";
5import * as z from "zod";
6import { Button } from "@/components/ui/button";
7import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card";
8import { Input } from "@/components/ui/input";
9import { Label } from "@/components/ui/label";
10import { toast } from "sonner";
11import { Textarea } from "@/components/ui/textarea";
12
13const formSchema = z.object({
14 name: z.string().min(1, "Your Name is required"),
15 email: z.string().email("Invalid email address").min(1, "Email Address is required"),
16 subject: z.string().min(1, "Subject is required"),
17 message: z.string().min(1, "Message is required"),
18});
19
20type FormValues = z.infer<typeof formSchema>;
21export function ContactFormForm() {
22 const form = useForm<FormValues>({
23 resolver: zodResolver(formSchema),
24 defaultValues: {
25 name: "",
26 email: "",
27 subject: "",
28 message: "",
29 },
30 });
31
32 const onSubmit = async (data: FormValues) => {
33 console.log("Form submitted:", data);
34 toast.success("Form submitted successfully!");
35 };
36
37 return (
38 <Card className="w-full max-w-md mx-auto">
39 <CardHeader>
40 <CardTitle>Contact Form</CardTitle>
41 <CardDescription>Basic contact form with name, email, and message</CardDescription>
42 </CardHeader>
43 <CardContent>
44 <form onSubmit={form.handleSubmit(onSubmit)} className="space-y-4">
45 <div className="space-y-2">
46 <Label htmlFor="name">Your Name</Label>
47 <Input
48 id="name"
49 type="text"
50 placeholder="John Doe"
51 {...form.register("name")}
52 />
53 {form.formState.errors.name && (
54 <p className="text-sm text-destructive">{form.formState.errors.name.message}</p>
55 )}
56 </div>
57
58 <div className="space-y-2">
59 <Label htmlFor="email">Email Address</Label>
60 <Input
61 id="email"
62 type="email"
63 placeholder="john@example.com"
64 {...form.register("email")}
65 />
66 {form.formState.errors.email && (
67 <p className="text-sm text-destructive">{form.formState.errors.email.message}</p>
68 )}
69 </div>
70
71 <div className="space-y-2">
72 <Label htmlFor="subject">Subject</Label>
73 <Input
74 id="subject"
75// … truncated

What it pulls in

npm packages

  • react-hook-form
  • @hookform/resolvers
  • zod
  • sonner

Other registry items

  • https://formscn.space/r/button.json
  • https://formscn.space/r/card.json
  • https://formscn.space/r/input.json
  • https://formscn.space/r/textarea.json
  • https://formscn.space/r/label.json
  • https://formscn.space/r/select.json

Files it writes

  • src/registry/default/templates/contact-form.tsx

Facts

Registry
formscn
Type
registry:block
Access
Free
Files written
1
Licence
the repository states none
First indexed
2026-08-01
Last confirmed
yesterday

Go to the source

formscn.space AbdullahMukadam/formscn on GitHub Raw registry item This item as JSON

More from formscn

All 30 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
base-formbase-formformscnBlocksFree2 deps
booking-request-formbooking-request-formformscnBlocksFree4 deps
detailed-application-formdetailed-application-formformscnBlocksFree6 deps
ecommerce-checkout-formecommerce-checkout-formformscnBlocksFree4 deps
event-registration-formevent-registration-formformscnBlocksFree4 deps
feedback-formfeedback-formformscnBlocksFree4 deps
job-application-formjob-application-formformscnBlocksFree6 deps
login-formlogin-formformscnBlocksFree4 deps
BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex