# formik-adapter-zod

> An adapter of zod object validation to Formik validation schema

Latest version **1.1.2** (published 2022-12-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install formik-adapter-zod
pnpm add formik-adapter-zod
yarn add formik-adapter-zod
bun add formik-adapter-zod
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.2 |
| Published | 2022-12-15 |
| First published | 2022-12-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 10.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Luke Askew |
| Maintainers | lukem121 |

## Links

- npm: https://www.npmjs.com/package/formik-adapter-zod
- Repository: https://github.com/lukem121/formik-adapter-zod
- Homepage: https://github.com/lukem121/formik-adapter-zod#readme
- Issues: https://github.com/lukem121/formik-adapter-zod/issues
- npm.io page: https://npm.io/package/formik-adapter-zod

## Recent versions

- 1.1.2 (latest) — 2022-12-15
- 1.1.1 — 2022-12-15
- 1.1.0 — 2022-12-15

## README

# formik-adapter-zod

## Works with react v18

This library adapts a [zod](https://www.npmjs.com/package/zod) schema to work as a `validationSchema` prop on [Formik](https://www.npmjs.com/package/formik)

**IMPORTANT: Currently, this library does not work with zod union. See more [here](https://github.com/lukem121/formik-adapter-zod/issues/2).**

## Install

```sh
# npm
$ npm install formik-adapter-zod

# yarn
$ yarn add formik-adapter-zod
```

## Usage

```TSX
import { z } from 'zod';
import { Formik } from 'formik';
import { toFormikValidationSchema } from 'formik-adapter-zod';

const Schema = z.object({
  name: z.string(),
  age: z.number(),
});

const Component = () => (
  <Formik
    validationSchema={toFormikValidationSchema(Schema)}
  >
    {...}
  </Formik>
);
```

---
_Source: https://npm.io/package/formik-adapter-zod · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
