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