Skip to content

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

react-native-scrollable-view

Inspired by https://github.com/brentvatne/react-native-scrollable-tab-view

I want to use scrollable view without tab. I cannot find react-native plugin so I forked react-native-scrollable-tab-view and strip of tab component.

Thanks @brentvatne!

Tested with react-native 0.20

Add it to your project

  1. Run npm install react-native-scrollable-view --save
  2. var ScrollableView = require('react-native-scrollable-view');

Demo

Basic usage

var ScrollableView = require('react-native-scrollable-view');

var App = React.createClass({
  render() {
    return (
      <ScrollableView>
        <Text pageLabel="1"> View 1</Text>
        <Text pageLabel="2"> View 2</Text>
        <Text pageLabel="3"> View 3</Text>
      </ScrollableView>
    );
  }
});

Example

See examples/FacebookTabsExample.

Props

  • onChangePage (Function) - function to call when Page changes, should accept 1 argument which is an Object containing two keys: i: the index of the tab that is selected, ref: the ref of the tab that is selected
  • onScroll (Function) - function to call when the pages are sliding, should accept 1 argument which is an Float number representing the page position in the slide frame.
  • locked (Bool) - disables horizontal dragging to scroll between tabs, default is false.
  • initialPage (Integer) - the index of the initially selected tab, defaults to 0 === first tab.
  • page (Integer) - set selected page(can be buggy see #126
  • style (View.propTypes.style)
  • contentProps (Object) - props that are applied to root ScrollView/ViewPagerAndroid. Note that overriding defaults set by the library may break functionality; see the source for details.

MIT Licensed

About

Inspired by https://github.com/brentvatne/react-native-scrollable-tab-view I want to use scrollable view without tab. I cannot find react-native plugin so I forked react-native-scrollable-tab-view and strip of tab component. Thanks @brentvatne!

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages