A powerful React hook that wraps TanStack Form with shadcn/ui components. Features schema validation, multi-page support, component overrides, and custom wrappers.
npx shadcn@latest add https://formedible.dev/r/use-formedible.json
Everything you need for building powerful forms with shadcn/ui
npx shadcn@latest add https://formedible.dev/r/use-formedible.json
This installs the hook, all field components, and their dependencies automatically.
import { useFormedible } from "@/hooks/use-formedible";
import { z } from "zod";
const schema = z.object({
email: z.string().email("Invalid email"),
message: z.string().min(10, "Message too short"),
});
export function MyForm() {
const { Form } = useFormedible({
schema,
fields: [
{ name: "email", type: "email", label: "Email" },
{ name: "message", type: "textarea", label: "Message" },
],
formOptions: {
defaultValues: { email: "", message: "" },
onSubmit: async ({ value }) => console.log(value),
},
});
return <Form />;
}
hooks/use-formedible.tsx
- Main form hookcomponents/fields/*
- All field components (text, select, date, etc.)Explore the interactive builder and comprehensive documentation