React component that render with nicer interface

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

PropertyTypeDescriptionDefault valueRequired
srcStringImage urlYes
sourcesArray Sets of
attributes: srcSet
, sizes
, media
and type
[]No
width
DOMString
Image widthNo
height
DOMString
Image heightNo
altString Alternative text for ""No
classNameString className
property for component
""No
flexibleBooleanMake component fluid falseNo
fitString CSS object-fit
property for
( contain
or cover
)
No
fitFallbackBoolean Force component to use background-image falseNo

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

使用声明 | 英豪名录