Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
react-native-pages
Advanced tools
Easy to use page view component for React Native
npm install --save react-native-pages
import React, { Component } from 'react';
import { Pages } from 'react-native-pages';
class Example extends Component {
render() {
return (
<Pages>
<View style={{ flex: 1, backgroundColor: 'red' }} />
<View style={{ flex: 1, backgroundColor: 'green' }} />
<View style={{ flex: 1, backgroundColor: 'blue' }} />
</Pages>
);
}
}
name | description | type | default |
---|---|---|---|
horizontal | Scroll direction | Boolean | true |
rtl | RTL mode for horizontal scroll | Boolean | false |
startPage | Start page | Number | 0 |
indicatorColor | Page indicator color | String | rgb(255, 255, 255) |
indicatorOpacity | Page indicator opacity (inactive dots) | Number | 0.30 |
indicatorPosition | Page indicator position | String | bottom |
containerStyle | Style for container view | Object | - |
progress | Animated.Value updated with progress | Object | - |
onScrollStart | Scroll start callback | Function | - |
onScrollEnd | Scroll end callback | Function | - |
onHalfway | Dominant page change callback | Function | - |
renderPager | Render pager callback | Function | - |
Possible values for indicatorPosition
are none
, top
, right
, bottom
and left
name | description | returns |
---|---|---|
scrollToPage | Scroll to page with optional animation | - |
isDragging | Returns whether the user has begun scrolling | Boolean |
isDecelerating | Returns whether content is moving after scrolling | Boolean |
import { Indicator, Pages } from 'react-native-pages';
class Example extends Component {
_renderPager = (options) => {
let {
rtl,
pages,
progress,
horizontal,
indicatorColor,
indicatorOpacity,
indicatorPosition,
} = options;
if ('none' === indicatorPosition) {
return null;
}
return (
<Indicator {...options} />
);
};
render() {
let { children, ...props } = this.props;
return (
<Pages {...props} renderPager={this._renderPager}>
{children}
</Pages>
);
}
}
For implementation details take look at Indicator component
All child components receive the following props
name | description | type |
---|---|---|
index | Page index | Number |
pages | Page count | Number |
progress | Animated.Value with current progress | Object |
For usage example take look at example app source code
git clone https://github.com/n4kz/react-native-pages
cd react-native-pages/example
npm install
npm run ios # or npm run android
BSD License
Copyright 2017-2019 Alexander Nazarov. All rights reserved.
FAQs
Easy to use page view component
The npm package react-native-pages receives a total of 448 weekly downloads. As such, react-native-pages popularity was classified as not popular.
We found that react-native-pages demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.