nyc_form

1.0.2 • Public • Published

A React Form Module

An example library for NYC Coding Exercise.

Install

To install it, make sure you have the peer dependencies:

yarn add nyc_form evergreen-ui react prop-types

Quickstart

This library is designed to cover a common use case (collecting basic user information in a form) and be extensible enough to allow the collection of additional information.

This is done by passing an array of steps as a prop, in this format:

const steps = [
  { title: "First step", kinds: ["email", "password"] },
  { title: "Details", kinds: ["name", "age"] },
  { title: "Final Question", kinds: ["favorite_food"] },
];

And then you can use the main FormApp component like so

import { FormApp } from "nyc_form";

<FormApp steps={steps} title="Example Form" />;

The four standard kinds are "email", "password", "name", and "age". Any kind that doesn't match one of those (e.g. "favorite_food" above) will simply use a text input field.

Dev

Clone the repo, and run yarn && yarn start or npm install && npm start and visit http://localhost:8080/src/dev/to get started with local development.

Readme

Keywords

none

Package Sidebar

Install

npm i nyc_form

Weekly Downloads

2

Version

1.0.2

License

MIT

Unpacked Size

716 kB

Total Files

15

Last publish

Collaborators

  • zschwartz