Nonstop Perpetual Motion

    swipe-actions

    1.1.0 • Public • Published

    SwipeActions

    React Native component for firing actions based on swipe gestures:

    ScreenShot

    Install

    npm install swipe-actions --save

    Use

    Wrap main component in <SwipeActions />, pass two components and two callbacks as the upper and lower actions:

    const mainComponent = (<View>
      <Text>
        Child Component
      </Text>
    </View>);
     
    // components shown on swipe
    const node = pos => (
      <View>
        <Text>
          {`${pos} Action`}
        </Text>
      </View>);
     
    // callbacks fired on release
    const action = pos => () =>
      Alert.alert(`${pos} Action Fired!`);
     
    <SwipeActions
       upperAction={action('Upper')}
       lowerAction={action('Lower')}
       upperNode={node('Upper')}
       lowerNode={node('Lower')}>
      {mainComponent}
    </SwipeActions>

    Please ★ on GitHub!

    Install

    npm i swipe-actions

    DownloadsWeekly Downloads

    8

    Version

    1.1.0

    License

    MIT

    Last publish

    Collaborators

    • lucasmreis