auto-size-background
v0.2.3
Published
Background component that adapts to screen changes
Readme
Auto Size Background
Auto Size Background can set background image auto fit screen
Example
Stretch the webpage to see the effect
Installation
npm i --save auto-size-backgroundImport the components you need, example:
import React from 'react'
import AutoSizeBackground from 'auto-size-background'
import img from 'img-link-here'
export default props => {
return (
<AutoSizeBackground src={img}>
{props.children}
</AutoSizeBackground>
)
}API
| 参数 | 说明 | 类型 | 默认值 |
| :-------------- | :------------ | :---- | :----- |
| src | 图片地址 | string | - |
| dtl | 图片伸缩方向,现在支持垂直、水平 | vertical | horizontal | horizontal |
Run from local
$ npm install
$ npm startLICENSE
MIT
