Skip to content
Dumb UI

Search Dumb UI

Jump to a page or component, or switch the style

Search Dumb UI

Jump to a page or component, or switch the style

Form

react-hook-form + zod wiring with accessible labels, descriptions and error messages.

Forms
@

Shown on your public profile.

Anyone with the link can view it.

$ pnpm dlx shadcn@latest add @dumb/form

Needs the @dumb registry in components.json and the style tokens. See Installation.

import {
  Form,
  FormControl,
  FormDescription,
  FormField,
  FormItem,
  FormLabel,
  FormMessage,
} from "@/components/ui/form"
<Form {...form}>
  <form onSubmit={form.handleSubmit(onSubmit)}>
    <FormField
      control={form.control}
      name="handle"
      render={({ field }) => (
        <FormItem>
          <FormLabel>Handle</FormLabel>
          <FormControl>
            <Input {...field} />
          </FormControl>
          <FormMessage />
        </FormItem>
      )}
    />
  </form>
</Form>