React component that render with nicer interface

移动开发 Github

SuperImage

React component that render
with nicer interface

Install

$ npm install --save super-image

This package use Object.assign()
, so you may need to polyfill via
object.assign

.

Usage


Use
element

Set sources
property.


Use object-fit
fallback

Set fitFallback
property true
.


Config

Property Type Description Default value Required
src String Image url Yes
sources Array Sets of
attributes: srcSet
, sizes
, media
and type
[] No
width
DOMString
Image width No
height
DOMString
Image height No
alt String Alternative text for "" No
className String className
property for component
"" No
flexible Boolean Make component fluid false No
fit String CSS object-fit
property for
( contain
or cover
)
No
fitFallback Boolean Force component to use background-image false No

License

MIT © FRESH!

Github稿源:Github (源链) | 关于 | 阅读提示

本站遵循[CC BY-NC-SA 4.0]。如您有版权、意见投诉等问题,请通过eMail联系我们处理。
酷辣虫 » 移动开发 » React component that render with nicer interface

喜欢 (0)or分享给?

专业 x 专注 x 聚合 x 分享 CC BY-NC-SA 4.0

使用声明 | 英豪名录