shadcn.io is an independent project built on shadcn/ui
Name needs 2 characters and says Your full name. Email must be an address and says Your email address. Both start empty. Submit checks them together.
Use it for a contact request or a waitlist. A message as well means adding a Textarea. In React, Ark UI does not write the descriptions.
Installation
Usage
<form className="w-full max-w-md" onSubmit={form.handleSubmit(onSubmit)}>
<FieldGroup>
<Controller
control={form.control}
name="name"
render={({ field, fieldState }) => (
<Field invalid={fieldState.invalid}>
<FieldLabel>Name</FieldLabel>
<Input {...field} placeholder="John Doe" />
<FieldDescription>Your full name.</FieldDescription>
<FieldError>{fieldState.error?.message}</FieldError>
</Field>
)}
/>
<Controller
control={form.control}
name="email"
render={({ field, fieldState }) => (
<Field invalid={fieldState.invalid}>
<FieldLabel>Email</FieldLabel>
<Input {...field} placeholder="john@example.com" type="email" />
<FieldDescription>Your email address.</FieldDescription>
<FieldError>{fieldState.error?.message}</FieldError>
</Field>
)}
/>
<Field orientation="horizontal">
<Button type="submit">Submit</Button>
</Field>
</FieldGroup>
</form>FAQ
Which two fields does this form register?
name is z.string().min(2, …) with "Name must be at least 2 characters." email is z.email(…) with "Please enter a valid email address." Each has its own Controller, and the input takes the controller's field props.
What do the descriptions say?
Name's FieldDescription is "Your full name." Email's is "Your email address." The placeholders are John Doe and john@example.com.
How is the email input different from name?
It sets type="email", so phones show an email keyboard; name is a text input. Field links each label to its input, with no ids.
What are the starting values?
defaultValues sets email and name to empty strings, so an empty submit fails both rules. The form is w-full max-w-md.
API Reference
Field
Sets invalid={fieldState.invalid} and orientation="horizontal". The rest is on the Field page.
Input
Sets field, placeholder="John Doe", placeholder="john@example.com" and type="email". The rest is on the Input page.
Button
Sets type="submit". The rest is on the Button page.





