Giter Site home page Giter Site logo

trickyc0d3r / react-native-action-view Goto Github PK

View Code? Open in Web Editor NEW

This project forked from wix-incubator/react-native-action-view

0.0 0.0 0.0 219 KB

An easy to use component that allows displaying swipeable buttons with a variety of transitions.

License: MIT License

Python 1.93% Java 1.47% JavaScript 7.07% Objective-C 89.54%

react-native-action-view's Introduction

React Native Action View

react-native-action-view is an easy to use component that allows displaying swipeable buttons with a variety of transitions.

Using

Import the component:

import { SwipeActionView } from 'react-native-action-view';

Use the component:

<SwipeActionView rightExpansionSettings={{buttonIndex: 0}}
                 leftExpansionSettings={{buttonIndex: 0}} 
                 rightButtons={[{title: 'Red', color: 'rgb(255, 0, 0)', callback: () => {alert('Red button tapped.');}}, 
                                {title: 'Green', color: 'rgb(0, 255, 0)', callback: () => {alert('Green button tapped.');}},
                                {title: 'Blue', color: 'rgb(0, 0, 255)', callback: () => {alert('Blue button tapped.');}}]}
                 leftButtons={[{title: 'Red', color: 'rgb(255, 0, 0)', callback: () => {alert('Red button tapped.');}}, 
                                {title: 'Green', color: 'rgb(0, 255, 0)', callback: () => {alert('Green button tapped.');}},
                                {title: 'Blue', color: 'rgb(0, 0, 255)', callback: () => {alert('Blue button tapped.');}}]}
                >
  <Text style={styles.welcome}>
    Welcome to React Native!
  </Text>
  <Text style={styles.instructions}>
    To get started, swipe this view.
  </Text>
  <Text style={styles.instructions}>
    Tap on a button or swipe fully.
  </Text>
</SwipeActionView>

Configuration

Possible props are:

  • leftButtons, rightButtons
    • title or image, color, callback
  • leftExpansionSettings, rightExpansionSettings - Control the button expansion settings
    • buttonIndex - The button to expand (Number)
    • fillOnTrigger - Whether to fill the button upon expansion (Boolean)
    • threshold - The treshold, in points, before expansion begins (Number)
  • leftSwipeSettings, rightSwipeSettings - Control swipe settings
    • transition - The transition type (String)
      • Available types: "static" (default), "border", "drag", "clipCenter", "rotate3d", "grow"
    • enableSwipeBounces - Controls if the swipe motion bounces or not (Boolean)

Transitions Types

Border

Clip

Rotate3D

Static

Drag

react-native-action-view's People

Contributors

leonatan avatar artald avatar gran33 avatar yogevbd avatar guyca avatar zidail avatar xxllexx avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.