mdform

0.0.1 • Public • Published

MDForm

GitHub issues GitHub license NPM

A light-weight react form component

Demo

demo

Properties


  • fields: array - array of configurations for input fields in your form. (required)
  • buttons: array - array of configurations for button fields in your form. (required)
  • url: string - the url you want your form to post or get. (default to '#')
  • method: string - the method you want your form to apply. (default to 'POST')

more specific proptypes

{
  fields: PropTypes.arrayOf(PropTypes.shape({
    fieldName: PropTypes.string.isRequired,
    displayName: PropTypes.string.isRequired,
    type: PropTypes.string,
  })),
  buttons: PropTypes.arrayOf(PropTypes.shape({
    text: PropTypes.string.isRequired,
    type: PropTypes.string,
    redirect: PropTypes.string,
    onClick: PropTypes.func,
  })),
  url: PropTypes.string,
  method: PropTypes.oneOf(['GET', 'POST']),
}

Readme

Keywords

none

Package Sidebar

Install

npm i mdform

Weekly Downloads

1

Version

0.0.1

License

MIT

Last publish

Collaborators

  • zhenghe