UNPKG

4.48 kBMarkdownView Raw
1apeman-react-form
2==========
3
4<!---
5This file is generated by ape-tmpl. Do not update manually.
6--->
7
8<!-- Badge Start -->
9<a name="badges"></a>
10
11[![Build Status][bd_travis_shield_url]][bd_travis_url]
12[![Code Climate][bd_codeclimate_shield_url]][bd_codeclimate_url]
13[![Code Coverage][bd_codeclimate_coverage_shield_url]][bd_codeclimate_url]
14[![npm Version][bd_npm_shield_url]][bd_npm_url]
15[![JS Standard][bd_standard_shield_url]][bd_standard_url]
16
17[bd_repo_url]: https://github.com/apeman-react-labo/apeman-react-form
18[bd_travis_url]: http://travis-ci.org/apeman-react-labo/apeman-react-form
19[bd_travis_shield_url]: http://img.shields.io/travis/apeman-react-labo/apeman-react-form.svg?style=flat
20[bd_license_url]: https://github.com/apeman-react-labo/apeman-react-form/blob/master/LICENSE
21[bd_codeclimate_url]: http://codeclimate.com/github/apeman-react-labo/apeman-react-form
22[bd_codeclimate_shield_url]: http://img.shields.io/codeclimate/github/apeman-react-labo/apeman-react-form.svg?style=flat
23[bd_codeclimate_coverage_shield_url]: http://img.shields.io/codeclimate/coverage/github/apeman-react-labo/apeman-react-form.svg?style=flat
24[bd_gemnasium_url]: https://gemnasium.com/apeman-react-labo/apeman-react-form
25[bd_gemnasium_shield_url]: https://gemnasium.com/apeman-react-labo/apeman-react-form.svg
26[bd_npm_url]: http://www.npmjs.org/package/apeman-react-form
27[bd_npm_shield_url]: http://img.shields.io/npm/v/apeman-react-form.svg?style=flat
28[bd_standard_url]: http://standardjs.com/
29[bd_standard_shield_url]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg
30
31<!-- Badge End -->
32
33
34<!-- Description Start -->
35<a name="description"></a>
36
37apeman react package for form component.
38
39<!-- Description End -->
40
41
42<!-- Overview Start -->
43<a name="overview"></a>
44
45
46
47<!-- Overview End -->
48
49
50<!-- Sections Start -->
51<a name="sections"></a>
52
53<!-- Section from "doc/guides/01.Installation.md.hbs" Start -->
54
55<a name="section-doc-guides-01-installation-md"></a>
56Installation
57-----
58
59```bash
60$ npm install apeman-react-form --save
61```
62
63
64<!-- Section from "doc/guides/01.Installation.md.hbs" End -->
65
66<!-- Section from "doc/guides/02.Demo.md.hbs" Start -->
67
68<a name="section-doc-guides-02-demo-md"></a>
69Demo
70-----
71
72[Live demo][demo_url] is hosted on GitHub Pages.
73
74[demo_url]: http://apeman-react-labo.github.io/apeman-react-form/demo/demo.html
75
76
77<!-- Section from "doc/guides/02.Demo.md.hbs" End -->
78
79<!-- Section from "doc/guides/03.Usage.md.hbs" Start -->
80
81<a name="section-doc-guides-03-usage-md"></a>
82Usage
83---------
84
85```jsx
86'use strict'
87
88import React from 'react'
89import {ApText} from 'apeman-react-text'
90import {ApForm} from 'apeman-react-form'
91
92const ExampleComponent = React.createClass({
93 render() {
94 return (
95 <div>
96 <ApFormStyle />
97 <ApForm errors={
98 {
99 account_name: {
100 required: true
101 }
102 }
103 }>
104 <ApText name="account_name"
105 onChange={ _handleChange }/>
106 </ApForm>
107 </div>
108
109 )
110 }
111})
112
113```
114
115
116
117<!-- Section from "doc/guides/03.Usage.md.hbs" End -->
118
119<!-- Section from "doc/guides/04.Components.md.hbs" Start -->
120
121<a name="section-doc-guides-04-components-md"></a>
122Components
123-----
124
125
126### ApFormStyle
127
128**Props**
129
130| Name | Type | Default | Description |
131| ---- | ---- | ------- | ----------- |
132| type | string | &#x27;text/css&#x27; | | |
133| style | object | {} | | |
134| maxWidth | number | | | |
135| errorColor | | &#x27;#E11&#x27; | | |
136| errorBackgroundColor | | &#x27;#FFF0F0&#x27; | | |
137
138### ApForm
139
140**Props**
141
142| Name | Type | Default | Description |
143| ---- | ---- | ------- | ----------- |
144| errors | object | null | | |
145| spinning | bool | false | | |
146| spinner | string | ApSpinner.DEFAULT_THEME | | |
147| centered | bool | false | | |
148| onEnterKeyPress | func | null | | |
149
150
151
152<!-- Section from "doc/guides/04.Components.md.hbs" End -->
153
154
155<!-- Sections Start -->
156
157
158<!-- LICENSE Start -->
159<a name="license"></a>
160
161License
162-------
163This software is released under the [MIT License](https://github.com/apeman-react-labo/apeman-react-form/blob/master/LICENSE).
164
165<!-- LICENSE End -->
166
167
168<!-- Links Start -->
169<a name="links"></a>
170
171Links
172------
173
174+ [apeman](https://github.com/apeman-labo/apeman)
175+ [apeman-react-labo](https://github.com/apeman-react-labo)
176+ [React](https://facebook.github.io/react/)
177+ [Demo of apeman-react-form](http://apeman-demo-labo.github.io/apeman-react-form/demo/demo.html)
178
179<!-- Links End -->