2.2.0 • Published 5 months ago

formik-validator-zod v2.2.0

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

Formik Validator Zod

Allows you to easily validate Formik forms with the power of Zod schemas.

Installation

To install from NPM:

npm install formik-validator-zod

pnpm add formik-validator-zod

yarn add formik-validator-zod

bun add formik-validator-zod

Usage

import { Formik } from 'formik'
import { z } from 'zod'
import { withZodSchema } from 'formik-validator-zod'

const mySchema = z.object({
  email: z.string().email(),
  name: z.string(),
  age: z.number(),
})

const MyForm = () => {
  return (
    <Formik validate={withZodSchema(mySchema)} {...}>
      {...}
    </Formik>
  )
}

Is this library still maintained?

Yes! This library is used in a couple of production codebases that I'm aware of, including my current employers.

I don't expect the library will need a lot of active maintenance going forwards. This is due to its limited scope and the fact Formik itself seems to be abandoned.

2.2.0

5 months ago

2.1.1

5 months ago

2.1.0

5 months ago

2.0.1

1 year ago

2.0.0

2 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago