react-native-swipe-picker

0.1.4 • Public • Published

react-native-swipe-picker

An inline picker with swipe-to-select-an-item interaction

Example

Swipe Picker Example

This is a screenshot from the demo app, that is located in the demo folder.

Installation

In an existing react-native or expo project run:

npm install --save react-native-swipe-picker

or

yarn add react-native-swipe-picker

Usage

/* ... */
import SwipePicker from 'react-native-swipe-picker'
 
/* ... */
 
export default () => {
  return (
    { /* ... */ }
      <SwipePicker
        items={[
          {
            value: 101,
            label: 'Item 101'
          },
          {
            value: 202,
            label: 'Item 202'
          },
          {
            value: 303,
            label: 'Item 303'
          },
          {
            value: 404,
            label: 'Item 404'
          },
          {
            value: 505,
            label: 'Item 505'
          }
        ]}
        onChange={ ({ index, item }) => {
          console.log( `Selected index: ${ index }` );
          console.log( `Selected item: ${ item }` );
        }}
        height={ 80 }
        width={ 120 }
       />
    { /* ... */ }
  )
}
 
/* ... */
 

Package Sidebar

Install

npm i react-native-swipe-picker

Weekly Downloads

19

Version

0.1.4

License

MIT

Unpacked Size

1.01 MB

Total Files

248

Last publish

Collaborators

  • ninarski