useZodForm (ui/form.tsx)

Snouzy/workout-cool · src/components/ui/form.tsx · typescript · MIT
ui

A React Hook Form component suite that integrates Zod validation for accessible, type-safe form building.

// Source: https://github.com/Snouzy/workout-cool | License: MIT | Copyright 2023 Mathias Bradiceanu
// Provided via justclaw.it.com; keep this notice with the code.
import { Controller, FormProvider, useForm, useFormContext } from "react-hook-form";
import * as React from "react";
import { TriangleAlert } from "lucide-react";
import { useI18n } from "locales/client";
import { Slot } from "@radix-ui/react-slot";
import { zodResolver } from "@hookform/resolvers/zod";


import { Label } from "./label";

import type { z, ZodSchema } from "zod";
import type { ControllerProps, FieldPath, FieldValues, SubmitHandler, UseFormProps, UseFormReturn } from "react-hook-form";
import type * as LabelPrimitive from "@radix-ui/react-label";

import { cn } from "@/shared/lib/utils";

type FormProps<T extend

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key