Giter VIP home page Giter VIP logo

react-ptr's Introduction

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

react-ptr's People

Contributors

n7best avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.