Preferred form library with Next.js?

This page summarizes the projects mentioned and recommended in the original post on /r/nextjs

Our great sponsors
  • SurveyJS - Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • next-joi

    Validate NEXT.js API Routes with joi

  • I see there is next-joi api example but which form library integrates well with Joi schemas?

  • youtube-2021-march-nextjs-api-routes-validation-yup

    Next.js API Routes validation shared with front-end using yup

  • I know Yup schemas are native for Formik but then for api best example that I found is this but this is not some high level integration, just validate() function is called in middleware before api handler.

  • SurveyJS

    Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.

    SurveyJS logo
  • zod

    TypeScript-first schema validation with static type inference

  • It's a bit of a PITA to do validation in API routes. If you use TypeScript - check out ZOD: https://github.com/colinhacks/zod, if no - joi is way to go.

  • resolvers

    📋 Validation resolvers: Yup, Zod, AJV, Joi, Superstruct, Vest, class-validator, io-ts, typanion, Ajv, TypeBox, Valibot and nope.

  • For the front-end, I like react-hook-form, and it supports both zod, joi, yup and more via official package: https://github.com/react-hook-form/resolvers

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts