New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

a-plus-forms-json-validator

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

a-plus-forms-json-validator

JSON Schema validator

  • 1.0.6
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
7
decreased by-46.15%
Maintainers
1
Weekly downloads
 
Created
Source

A+ Forms JSON Schema Validator

This a plugin for the A+ forms that enables JSON schemas based forms validation.

Installation

npm install a-plus-forms
npm install a-plus-forms-json-validator

Usage

import { Form, ValidatorProvider, EmailInput, PasswordInput } from 'a-plus-forms';
import Validator from 'a-plus-forms-json-validator';

const schema = {
  type: 'object',
  properties: {
    email: { type: 'string', format: 'email' },
    password: { type: 'string' }
  },
  required: ['email', 'password']
};

const SignInForm = ({ onSubmit }) =>
  <ValidatorProvider validator={Validator}>
    <Form schema={schema} onSubmit={onSubmit}>
      <EmailInput name="username" label="Username" />
      <PasswordInput name="password" label="Password" />
    </Form>
  </ValidatorProvider>;

The ValidatorProvider doesn't have to be right next to the Form. The best practice is to place it next to your redux store provider or such, at the app root scope level.

All code in this repo is released under the terms of the MIT license. Copyright (C) 2017 Niklay Nemshilov

Keywords

FAQs

Package last updated on 01 Jun 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc