0.1.3 • Published 4 years ago
@haoxuan8/react-spin v0.1.3
@haoxuan8/react-spin

Install
npm install @haoxuan8/react-spin -SUsage
import Spin from '@haoxuan8/react-spin'
render(
<Spin spinning>
<div>Content</div>
</Spin>,
document.querySelector('#root')
)Static Method
Spin.setDefaultIndicator(indicator: ReactNode)Spin.clearDefaultIndicator()
Props
| Name | Type | Default | Description |
|---|---|---|---|
| spinning | Boolean | false | Spinning |
| indicator | ReactNode | undefined | Custom icon when loading. Hide indicator if set indicator as null |
| opacity | Number | 0.5 | The opacity of content when loading |
| tip | String | undefined | The text below indicator |
| mainColor | String | #409eff | The color of default indicator |
| fontColor | String | #409eff | The color of tip |
| size | Number | 42 | The size(px) of default indicator |
| maxHeight | Number | none | 400 | Default maxHeight(px) of indicator container. Indicator will be placed in the center of that container. If you want to place indicator in the center of children, just set this attribute as none |