0.4.3 • Published 9 months ago

@formsignals/validation-adapter-zod v0.4.3

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

validation-adapter-zod-version validation-adapter-zod-bundle

The zod validation adapter for form management with Preact Signals.

Features

  • TypeScript - Written in TypeScript with full type support for optimal DX.
  • Reactivity - Reactivity without abstractions thanks to Preact Signals.
  • Validation - Built-in validation support, including adapters for validation schema libraries.
  • Transformations - Transform values for the specific needs of your input fields.
  • Async Data - Easily manage async initialisation, validation and submission.
  • Arrays + Dynamic Objects - Utilize arrays and dynamic objects within your forms.

Install

npm install @formsignals/validation-adapter-zod

If you have not installed zod yet, you will need to install it as well:

npm install zod

Quickstart

A form or field needs to receive a validation adapter during configuration to be able to use zod schemas.

const form = new FormLogic({
  defaultValues: {
    name: '',
    email: '',
  },
  validationAdapter: ZodAdapter,
});

Then you can create a field instance and configure it with a zod schema:

const nameField = form.getOrCreateField('name', {
  validate: Zod.string().min(3),
});
0.4.3

9 months ago

0.3.0

1 year ago

0.2.1

1 year ago

0.4.1

12 months ago

0.4.0

1 year ago

0.3.1

1 year ago

0.4.2

11 months ago

0.1.2

1 year ago

0.1.3

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago

0.0.10

1 year ago

0.0.13

1 year ago

0.0.7

1 year ago

0.0.3

1 year ago

0.0.4

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago