bootstrap3formtemplates
TypeScript icon, indicating that this package has built-in type declarations

1.9.3 • Public • Published

Introduction

Form Templates in support of doiforms

Getting Started

  1. Installation process

    install from npm using "npm i doiforms"

    to install the template form library run "npm i bootstrap3formtemplates"

  2. Software dependencies

    • React
    • doiforms
    • react-date-picker
    • react-datetime-picker
    • google-libphonenumber
  3. API references Basic usage looks something like this:

import { FormTemplate } from "bootstrap3formtemplates";
import {
  DOIFormComponent,
  EnumFieldType,
  IFieldState,
} from "doiforms";
import * as React from "react";
 
export default function MyForm(): JSX.Element{
    const field = {
      DisplayName: "Your Name",
      Id: "name",
      Name: "name",
      Order: 0,
      Required: true,
      Type: EnumFieldType.text };
    const submit = {
          DisplayName: "Submit",
          Id: "submitb",
          Name: "submitb",
          Order: 1,
          Required: true,
          Type: EnumFieldType.submit
        };
    return <DOIFormComponent        
        ErrorHandler={(ErrorMessage?: string, Stack?: string) => <h1>{ErrorMessage || "Error"}</h1><p>{Stack}</p>}
        Fields={[field,submit]}
        FormTemplate={FormTemplate}
        RedirectURL={"https://localhost"}
        SubmitAction={() => {
          return new Promise<void>(
            (resolve: () => void, reject: (reason: any) => void) => {
              resolve();
            });
        }} />;
}

Package Sidebar

Install

npm i bootstrap3formtemplates

Weekly Downloads

2

Version

1.9.3

License

ISC

Unpacked Size

58.9 kB

Total Files

42

Last publish

Collaborators

  • doiedokpayi