UNPKG

4.57 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_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<!-- Badge End -->
32
33
34<!-- Description Start -->
35<a name="description"></a>
36
37apeman react package for image 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-image --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-image/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, {PropTypes as types} from 'react'
91import {ApImage, ApImageStyle} from 'apeman-react-image'
92
93const 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<!-- Section from "doc/guides/03.Usage.md.hbs" End -->
114
115<!-- Section from "doc/guides/04.Components.md.hbs" Start -->
116
117<a name="section-doc-guides-04-components-md"></a>
118Components
119-----
120
121
122### ApImageStyle
123
124**Props**
125
126| Name | Type | Default | Description |
127| ---- | ---- | ------- | ----------- |
128| style | object | {} | | |
129| backgroundColor | string | &#x27;#DDD&#x27; | | |
130| spinColor | | &#x27;rgba(255,255,255,0.5)&#x27; | | |
131
132### ApImage
133
134**Props**
135
136| Name | Type | Default | Description |
137| ---- | ---- | ------- | ----------- |
138| scale | enum | &#x27;none&#x27; | | 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 | &#x27;NO IMAGE&#x27; | | 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<!-- Section from "doc/guides/04.Components.md.hbs" End -->
150
151
152<!-- Sections Start -->
153
154
155<!-- LICENSE Start -->
156<a name="license"></a>
157
158License
159-------
160This software is released under the [MIT License](https://github.com/apeman-react-labo/apeman-react-image/blob/master/LICENSE).
161
162<!-- LICENSE End -->
163
164
165<!-- Links Start -->
166<a name="links"></a>
167
168Links
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<!-- Links End -->