Skip to content

ninio/react-native-swipe-picker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

react-native-swipe-picker

An inline picker with swipe-to-select-an-item interaction. Similar to how one inputs blood pressure in SHealth App.

Example

Swipe Picker Example

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

Installation

Step 0: (Skip it if you're using expo) Install and configure the react-native-unimodules package

Step 1: Install the package:

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 }
       />
    { /* ... */ }
  )
}

/* ... */

About

A Picker with swiping as picking interaction.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published