0.0.2 • Published 4 years ago

ello-form-react v0.0.2

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

ello-form-react

react form

NPM JavaScript Style Guide

Install

npm install --save ello-form-react

Usage

import React, { Component } from "react";

import EllocentForm from "ello-form-react";

class Example extends Component {
  render() {
    return <EllocentForm
      fields = {[{
        label : "",
        name : "",
        component: "",
        value : "",
        size : ""
      }
      ...]}
    />;
  }
}

##Props

PropsDescription
fieldsArray of field Object
submitTextSubmit button text
onChangeCallback for on value change
onSubmitCallback for form submit. This will returns form data as json object
formCsscss class name for form conatiner
buttonContainerCsscss class name for submit button container
buttonCsscss class name for submit button
labelCsscss class name for all field labels
extraActionArray of button object

Fields

PropsDescription
nameName of field
labelLable text
placeholderplaceholder
componentone of "input", "select", "select-async", "check", "tag-input", "file",smart-textarea"
regularExpValidation reg exp
errorTextValidation error message
typeType of input filed. Required if component is "input"
checkedRequired if component is "check"
api/optionLoaderRequired if component is "select-async"
multiSelectOptional For "select" or "select-async" component
disabledDisable the field
stayOpenOnSelectOptional For "select" or "select-async" component
labelLable text
valuedefault value
optionsArray of '{label : "", value : "" }'. Required if component is "select" or "select-async".

License

MIT © CodeLover12