UNPKG

4.87 kBMarkdownView Raw
1apeman-react-radio
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-radio
18[bd_travis_url]: http://travis-ci.org/apeman-react-labo/apeman-react-radio
19[bd_travis_shield_url]: http://img.shields.io/travis/apeman-react-labo/apeman-react-radio.svg?style=flat
20[bd_license_url]: https://github.com/apeman-react-labo/apeman-react-radio/blob/master/LICENSE
21[bd_codeclimate_url]: http://codeclimate.com/github/apeman-react-labo/apeman-react-radio
22[bd_codeclimate_shield_url]: http://img.shields.io/codeclimate/github/apeman-react-labo/apeman-react-radio.svg?style=flat
23[bd_codeclimate_coverage_shield_url]: http://img.shields.io/codeclimate/coverage/github/apeman-react-labo/apeman-react-radio.svg?style=flat
24[bd_gemnasium_url]: https://gemnasium.com/apeman-react-labo/apeman-react-radio
25[bd_gemnasium_shield_url]: https://gemnasium.com/apeman-react-labo/apeman-react-radio.svg
26[bd_npm_url]: http://www.npmjs.org/package/apeman-react-radio
27[bd_npm_shield_url]: http://img.shields.io/npm/v/apeman-react-radio.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 radio 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-radio --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 Image](./doc/images/screenshot.png)][demo_url]
75
76[demo_url]: http://apeman-react-labo.github.io/apeman-react-radio/demo/demo.html
77
78
79<!-- Section from "doc/guides/02.Demo.md.hbs" End -->
80
81<!-- Section from "doc/guides/03.Usage.md.hbs" Start -->
82
83<a name="section-doc-guides-03-usage-md"></a>
84Usage
85---------
86
87```jsx
88'use strict'
89
90import React from 'react'
91import {ApRadio, ApRadioStyle} from 'apeman-react-radio'
92
93const html = (
94 <html>
95 <head>
96 <ApRadioStyle/>
97 </head>
98 <body>
99 <div>
100 <ApRadio name="favor" value="orange" title="I like orange." onChange={handleChange}/>,
101 <ApRadio name="favor" value="apple" title="I like apple." onChange={handleChange}/>
102 </div>
103 </body>
104 </html>
105)
106
107```
108
109
110
111<!-- Section from "doc/guides/03.Usage.md.hbs" End -->
112
113<!-- Section from "doc/guides/04.Components.md.hbs" Start -->
114
115<a name="section-doc-guides-04-components-md"></a>
116Components
117-----
118
119
120### ApRadioGroup
121
122**Props**
123
124| Name | Type | Default | Description |
125| ---- | ---- | ------- | ----------- |
126| prefix | string | null | Document id prefix |
127| name | string | null | Name of Radio input |
128| options | object | {} | Value and label titles |
129| checked | object | {} | Checked state for each values |
130| onChange | func | null | Handle for change event |
131| icon | string | ApRadio.DEFAULT_ICON | Icon class name for normal state |
132| checkedIcon | string | ApRadio.DEFAULT_CHECKED_ICON | Icon class name for checked state |
133| title | | '' | |
134
135### ApRadioStyle
136
137**Props**
138
139| Name | Type | Default | Description |
140| ---- | ---- | ------- | ----------- |
141| scope | bool | false | |
142| style | object | {} | |
143| highlightColor | string | '#38E' | |
144
145### ApRadio
146
147**Props**
148
149| Name | Type | Default | Description |
150| ---- | ---- | ------- | ----------- |
151| id | string | null | |
152| name | string | null | |
153| value | string | null | |
154| title | string | '' | |
155| checked | bool | false | |
156| onChange | func | null | |
157| icon | string | 'ion ion-ios-circle-outline' | |
158| checkedIcon | string | 'ion ion-ios-circle-filled' | |
159
160
161
162<!-- Section from "doc/guides/04.Components.md.hbs" End -->
163
164
165<!-- Sections Start -->
166
167
168<!-- LICENSE Start -->
169<a name="license"></a>
170
171License
172-------
173This software is released under the [MIT License](https://github.com/apeman-react-labo/apeman-react-radio/blob/master/LICENSE).
174
175<!-- LICENSE End -->
176
177
178<!-- Links Start -->
179<a name="links"></a>
180
181Links
182------
183
184+ [apeman](https://github.com/apeman-labo/apeman)
185+ [apeman-react-labo](https://github.com/apeman-react-labo)
186+ [React](https://facebook.github.io/react/)
187
188<!-- Links End -->