# @rjsf/validator-ajv8

> The ajv-8 based validator for @rjsf/core

Latest version **6.10.0** (published 2026-09-09) · Apache-2.0 license · 1.0M weekly downloads

## Install

```sh
npm install @rjsf/validator-ajv8
pnpm add @rjsf/validator-ajv8
yarn add @rjsf/validator-ajv8
bun add @rjsf/validator-ajv8
```

## Health

**Score 100/100 (A)** — status: active.

Positive: high downloads; has types; esm support; no vulnerabilities; has provenance; recently updated; high maintenance score; high quality score; popular repo.

## Facts

| | |
|---|---|
| Version | 6.10.0 |
| Published | 2026-09-09 |
| First published | 2022-09-06 |
| Weekly downloads | 1.0M |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=20 |
| Dependencies | 2 |
| Unpacked size | 329.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 15896 |
| Author | Heath Chiavettone |
| Maintainers | epicfaace, rjsf-bot |
| Keywords | react-jsonschema-form, jsonschema, json-schema, json, schema, form, react, ajv-8, rjsf-validator |

## Links

- npm: https://www.npmjs.com/package/@rjsf/validator-ajv8
- Repository: https://github.com/rjsf-team/react-jsonschema-form
- Homepage: https://github.com/rjsf-team/react-jsonschema-form#readme
- Issues: https://github.com/rjsf-team/react-jsonschema-form/issues
- npm.io page: https://npm.io/package/@rjsf/validator-ajv8

## Dependencies (2)

- [ajv](https://npm.io/package/ajv.md) ^8.20.0
- [ajv-formats](https://npm.io/package/ajv-formats.md) ^2.1.1

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 6.10.0 (latest) — 2026-09-09
- 6.0.0-beta.23 (next) — 2025-10-28
- 6.8.0 — 2026-08-14
- 6.7.1 — 2026-07-24
- 6.7.0 — 2026-07-17
- 6.6.2 — 2026-06-06
- 6.6.1 — 2026-05-28
- 6.6.0 — 2026-05-28
- 6.5.3 — 2026-05-17
- 6.5.2 — 2026-05-01
- 6.5.1 — 2026-04-18
- 6.5.0 — 2026-04-18
- 6.4.2 — 2026-03-28
- 6.4.1 — 2026-03-07
- 6.4.0 — 2026-03-07
- … 130 more at https://npm.io/package/@rjsf/validator-ajv8/versions

## README

[![Build Status][build-shield]][build-url]
[![npm][npm-shield]][npm-url]
[![npm downloads][npm-dl-shield]][npm-dl-url]
[![Contributors][contributors-shield]][contributors-url]
[![Apache 2.0 License][license-shield]][license-url]

<!-- PROJECT LOGO -->
<br />
<p align="center">

  <h3 align="center">@rjsf/validator-ajv8</h3>

  <p align="center">
  AJV-8 based validator plugin for <a href="https://github.com/rjsf-team/react-jsonschema-form/"><code>react-jsonschema-form</code></a>.
    <br />
    <a href="https://rjsf-team.github.io/react-jsonschema-form/docs/"><strong>Explore the docs »</strong></a>
    <br />
    <br />
    <a href="https://rjsf-team.github.io/react-jsonschema-form/">View Playground</a>
    ·
    <a href="https://github.com/rjsf-team/react-jsonschema-form/issues">Report Bug</a>
    ·
    <a href="https://github.com/rjsf-team/react-jsonschema-form/issues">Request Feature</a>
  </p>
</p>

<!-- TABLE OF CONTENTS -->

## Table of Contents

- [Table of Contents](#table-of-contents)
- [About The Project](#about-the-project)
  - [Built With](#built-with)
- [Getting Started](#getting-started)
  - [Prerequisites](#prerequisites)
  - [Installation](#installation)
- [Usage](#usage)
- [Roadmap](#roadmap)
- [Contributing](#contributing)
- [Contact](#contact)

<!-- ABOUT THE PROJECT -->

## About The Project

Exports `validator-ajv8` plugin for `react-jsonschema-form`.

### Built With

- [react-jsonschema-form](https://github.com/rjsf-team/react-jsonschema-form/)
- [AJV](https://github.com/ajv-validator/ajv/)
- [TypeScript](https://www.typescriptlang.org/)

<!-- GETTING STARTED -->

## Getting Started

### Prerequisites

#### React JsonSchema Form Utils

- `@rjsf/utils >= 5.0.0`

```bash
yarn add @rjsf/core
```

### Installation

```bash
yarn add @rjsf/validator-ajv8
```

<!-- USAGE EXAMPLES -->

## Usage

```tsx
import { RJSFSchema } from 'packages/utils/dist/index';
import Form from 'packages/core/dist/index';
import validator from '@rjsf/validator-ajv8';

const schema: RJSFSchema = {
  type: 'string',
};

<Form schema={schema} validator={validator} />;
```

or, using a more complex example using custom validator with custom formats

```tsx
import { RJSFSchema } from '@rjsf/utils';
import Form from '@rjsf/core';
import { customizeValidator } from '@rjsf/validator-ajv8';

const customFormats = {
  'phone-us': /\(?\d{3}\)?[\s-]?\d{3}[\s-]?\d{4}$/,
};

const validator = customizeValidator({
  customFormats,
});

const schema: RJSFSchema = {
  type: 'string',
  format: 'phone-us',
};

<Form schema={schema} validator={validator} />;
```

or, using a more complex example using a custom with additional meta schema

```tsx
import { RJSFSchema } from '@rjsf/utils';
import Form from '@rjsf/core';
import { customizeValidator } from '@rjsf/validator-ajv8';

const metaSchemaDraft06 = require('ajv/lib/refs/json-schema-draft-06.json');

const validator = customizeValidator({
  additionalMetaSchemas: [metaSchemaDraft06],
});

const schema: RJSFSchema = {
  $schema: 'http://json-schema.org/draft-06/schema#',
  type: 'string',
};

<Form schema={schema} validator={validator} />;
```

or, using a more complex example using custom validator config override options

```tsx
import { RJSFSchema } from '@rjsf/utils';
import Form from '@rjsf/core';
import { customizeValidator } from '@rjsf/validator-ajv8';

const validator = customizeValidator({
  ajvOptionsOverrides: {
    $data: true,
    verbose: true,
  },
});

const schema: RJSFSchema = {
  type: 'string',
};

<Form schema={schema} validator={validator} />;
```

or, using a more complex example using `ajv-formats` custom [format options](https://github.com/ajv-validator/ajv-formats).

```tsx
import { RJSFSchema } from '@rjsf/utils';
import Form from '@rjsf/core';
import { customizeValidator } from '@rjsf/validator-ajv8';

const validator = customizeValidator({
  ajvFormatOptions: {
    keywords: true,
    formats: ['date', 'time'],
  },
});

const schema: RJSFSchema = {
  type: 'string',
};

<Form schema={schema} validator={validator} />;
```

Finally, you can combine both additional meta schemas, custom formats, custom validator config override options and `ajv-formats` custom [format options](https://github.com/ajv-validator/ajv-formats).

```tsx
import { RJSFSchema } from '@rjsf/utils';
import Form from '@rjsf/core';
import { customizeValidator } from '@rjsf/validator-ajv8';

const metaSchemaDraft06 = require('ajv/lib/refs/json-schema-draft-06.json');

const customFormats = {
  'phone-us': /\(?\d{3}\)?[\s-]?\d{3}[\s-]?\d{4}$/,
};

const validator = customizeValidator({
  additionalMetaSchemas: [metaSchemaDraft06],
  customFormats,
  ajvOptionsOverrides: {
    $data: true,
    verbose: true,
  },
  ajvFormatOptions: {
    keywords: true,
    formats: ['date', 'time'],
  },
});

const schema: RJSFSchema = {
  $schema: 'http://json-schema.org/draft-06/schema#',
  type: 'string',
  format: 'phone-us',
};

<Form schema={schema} validator={validator} />;
```

<!-- ROADMAP -->

## Roadmap

See the [open issues](https://github.com/rjsf-team/react-jsonschema-form/issues) for a list of proposed features (and known issues).

<!-- CONTRIBUTING -->

## Contributing

Read our [contributors' guide](https://rjsf-team.github.io/react-jsonschema-form/docs/contributing/) to get started.

<!-- CONTACT -->

## Contact

rjsf team: [https://github.com/orgs/rjsf-team/people](https://github.com/orgs/rjsf-team/people)

GitHub repository: [https://github.com/rjsf-team/react-jsonschema-form](https://github.com/rjsf-team/react-jsonschema-form)

<!-- MARKDOWN LINKS & IMAGES -->
<!-- https://www.markdownguide.org/basic-syntax/#reference-style-links -->

[build-shield]: https://github.com/rjsf-team/react-jsonschema-form/workflows/CI/badge.svg
[build-url]: https://github.com/rjsf-team/react-jsonschema-form/actions
[contributors-shield]: https://img.shields.io/github/contributors/rjsf-team/react-jsonschema-form.svg
[contributors-url]: https://github.com/rjsf-team/react-jsonschema-form/graphs/contributors
[license-shield]: https://img.shields.io/badge/license-Apache%202.0-blue.svg?style=flat-square
[license-url]: https://choosealicense.com/licenses/apache-2.0/
[npm-shield]: https://img.shields.io/npm/v/@rjsf/validator-ajv8/latest.svg?style=flat-square
[npm-url]: https://www.npmjs.com/package/@rjsf/validator-ajv8
[npm-dl-shield]: https://img.shields.io/npm/dm/@rjsf/validator-ajv8.svg?style=flat-square
[npm-dl-url]: https://www.npmjs.com/package/@rjsf/validator-ajv8

---
_Source: https://npm.io/package/@rjsf/validator-ajv8 · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
