UNPKG

4.75 kBMarkdownView Raw
1apeman-react-image
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-image
18[bd_travis_url]: http://travis-ci.org/apeman-react-labo/apeman-react-image
19[bd_travis_shield_url]: http://img.shields.io/travis/apeman-react-labo/apeman-react-image.svg?style=flat
20[bd_travis_com_url]: http://travis-ci.com/apeman-react-labo/apeman-react-image
21[bd_travis_com_shield_url]: https://api.travis-ci.com/apeman-react-labo/apeman-react-image.svg?token=
22[bd_license_url]: https://github.com/apeman-react-labo/apeman-react-image/blob/master/LICENSE
23[bd_codeclimate_url]: http://codeclimate.com/github/apeman-react-labo/apeman-react-image
24[bd_codeclimate_shield_url]: http://img.shields.io/codeclimate/github/apeman-react-labo/apeman-react-image.svg?style=flat
25[bd_codeclimate_coverage_shield_url]: http://img.shields.io/codeclimate/coverage/github/apeman-react-labo/apeman-react-image.svg?style=flat
26[bd_gemnasium_url]: https://gemnasium.com/apeman-react-labo/apeman-react-image
27[bd_gemnasium_shield_url]: https://gemnasium.com/apeman-react-labo/apeman-react-image.svg
28[bd_npm_url]: http://www.npmjs.org/package/apeman-react-image
29[bd_npm_shield_url]: http://img.shields.io/npm/v/apeman-react-image.svg?style=flat
30[bd_standard_url]: http://standardjs.com/
31[bd_standard_shield_url]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg
32
33<!-- Badge End -->
34
35
36<!-- Description Start -->
37<a name="description"></a>
38
39apeman react package for image component.
40
41<!-- Description End -->
42
43
44<!-- Overview Start -->
45<a name="overview"></a>
46
47
48
49<!-- Overview End -->
50
51
52<!-- Sections Start -->
53<a name="sections"></a>
54
55<!-- Section from "doc/guides/01.Installation.md.hbs" Start -->
56
57<a name="section-doc-guides-01-installation-md"></a>
58Installation
59-----
60
61```bash
62$ npm install apeman-react-image --save
63```
64
65
66<!-- Section from "doc/guides/01.Installation.md.hbs" End -->
67
68<!-- Section from "doc/guides/02.Demo.md.hbs" Start -->
69
70<a name="section-doc-guides-02-demo-md"></a>
71Demo
72-----
73
74[Live demo][demo_url] is hosted on GitHub Pages.
75
76[![Demo Image](./doc/images/screenshot.png)][demo_url]
77
78[demo_url]: http://apeman-react-labo.github.io/apeman-react-image/demo/demo.html
79
80
81<!-- Section from "doc/guides/02.Demo.md.hbs" End -->
82
83<!-- Section from "doc/guides/03.Usage.md.hbs" Start -->
84
85<a name="section-doc-guides-03-usage-md"></a>
86Usage
87---------
88
89```jsx
90'use strict'
91
92import React, {PropTypes as types} from 'react'
93import {ApImage, ApImageStyle} from 'apeman-react-image'
94
95const ExampleComponent = React.createClass({
96 render () {
97 return (
98 <div>
99 <ApImageStyle
100 backgroundColor="#333"
101 />
102 <ApImage src="http://example.com/images/sample.png"
103 alt="This is it!"
104 scale="fit"
105 />
106 </div>
107 )
108 }
109})
110
111```
112
113
114
115<!-- Section from "doc/guides/03.Usage.md.hbs" End -->
116
117<!-- Section from "doc/guides/04.Components.md.hbs" Start -->
118
119<a name="section-doc-guides-04-components-md"></a>
120Components
121-----
122
123
124### ApImageStyle
125
126**Props**
127
128| Name | Type | Default | Description |
129| ---- | ---- | ------- | ----------- |
130| style | object | {} | | |
131| backgroundColor | string | &#x27;#DDD&#x27; | | |
132| spinColor | | &#x27;rgba(255,255,255,0.5)&#x27; | | |
133
134### ApImage
135
136**Props**
137
138| Name | Type | Default | Description |
139| ---- | ---- | ------- | ----------- |
140| scale | enum | &#x27;none&#x27; | | Image scaling policy |
141| width | number|string | 300 | | Image width |
142| height | number|string | 150 | | Image height |
143| src | string | null | | Image src string |
144| alt | string | &#x27;NO IMAGE&#x27; | | Alt test |
145| spinnerTheme | string | ApSpinner.DEFAULT_THEME | | Them of spinner |
146| onLoad | func | null | | Handler on image load |
147| onError | func | null | | Handler on image error. |
148
149
150
151<!-- Section from "doc/guides/04.Components.md.hbs" End -->
152
153
154<!-- Sections Start -->
155
156
157<!-- LICENSE Start -->
158<a name="license"></a>
159
160License
161-------
162This software is released under the [MIT License](https://github.com/apeman-react-labo/apeman-react-image/blob/master/LICENSE).
163
164<!-- LICENSE End -->
165
166
167<!-- Links Start -->
168<a name="links"></a>
169
170Links
171------
172
173+ [apeman](https://github.com/apeman-labo/apeman)
174+ [apeman-react-labo](https://github.com/apeman-react-labo)
175+ [React](https://facebook.github.io/react/)
176
177<!-- Links End -->