Skip to content

Requirements

What the backend and the frontend need.

Backend

The Python package pydantic-forms turns Pydantic models into form pages. See the installation guide for the supported Python and Pydantic versions and the extras, such as the FastAPI exception handler.

Frontend

The npm package pydantic-forms works in any React app. It does not depend on Next.js: the tutorial and the demo apps use Next.js, but the package does not import next, so it works in a Vite app as well.

The package needs React and React Hook Form: it renders React components, and the field components receive their props from React Hook Form. It also expects @hookform/resolvers, swr and next-intl (a React library despite its name, used for translations). The supported versions of these packages and of React are listed in package.json. npm installs them for you.

An API provider is required

PydanticForm needs an apiProvider in its config. It is a function that sends the request body to your backend and returns the response with its status. You can use fetch, axios or any other client, see Creating your first form.

Demo apps

The apps in this repository need Node.js 24.9 or later to run the monorepo tooling. The package itself sets no Node.js requirement.