0.0.5 • Published 7 years ago

react-ptr v0.0.5

Weekly downloads
7
License
MIT
Repository
github
Last release
7 years ago

React PTR - Pull To Refresh

license npm version

One mobile pull to refresh React component for all. Plug and play, highly customizable with many loaders provided!

default material modern rocket

Installation

With NPM

npm i react-ptr --save-dev

Import to your app

import { PullToRefresh, Loaders } from 'react-ptr';
import 'react-ptr/style.min.css';

Use with react

const App = () => (
    <PullToRefresh loaders={Loaders.Material}>
        <p> Your content here ... </p>
    </PullToRefresh>
)

Properties

  • height : string height for the container, use string like '10px', default for '100%'

  • onRefresh : func callback when refresh is request, pass resolve function as first parameters, default 2000ms auto resolve

  • loader : shape (optional) loader configuration shape consists of following properties

    • mode : string (optional) the method to display the loader container, chocie of using marginTop or absolute

    • loaderHeight : number (optional) the height of loader in px, applied to the container when user pull the container

    • loaderLoadingHeight : number (optional) the height of loader in px while in its loading state, default to equal to loaderHeight

    • loaderDefaultIcon : func (optional) a function that return an react element, pass in progress(1-100) as it's first parameter

    • loaderLoadingIcon : element (optional) a react element that display while loader in it's loading state