0.1.3 • Published 7 years ago

material-ui-pull-to-refresh v0.1.3

Weekly downloads
2
License
MIT
Repository
-
Last release
7 years ago

material-ui-pull-to-refresh

Pull to refresh for react based on material-ui.

Build Status

Installation

Install material-ui-pull-to-refresh.

npm install material-ui-pull-to-refresh

Then install its peer dependencies, if you haven't already:

npm install react material-ui

Usage

import PullToRefresh from 'material-ui-pull-to-refresh';
import React from 'react';


export default function App({children, onRefresh}) {
  return (
    <PullToRefresh onRefresh={onRefresh}>
      {children}
    </PullToRefresh>
  );
}

For a fully functional demo, clone this project, run npm install and run npm start.

PullToRefresh

A component that can be pulled in order to refresh content.

proptypedefaultrequireddescription
childrenReactNodenullThe child nodes to render inside the element. Note: The refresh indicator will be prepended to the children.
dragMultiplierNumber0.75How much to move the refresh indicator down compared to how much the user drags down.
indicatorSizeNumber40The size of the drag indicator in pixels.
maxDragNumber350The maximum amount that the refresh indicator can be dragged down.
onRefreshFunction:heavy_check_mark:A function to run when the indicator is pulled down and released. The function may either be synchronous or return a promise.
styleShape{}Additional styling for the container element. overflowY will be set by this component.
topOffsetNumber0The maximum offset which the user may have scrolled down. If this is set to a positive integer, the pulling down of the refresh indicator will start before the user hits the top of the scrolled element.

License

MIT

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago