All Projects → AppAndFlow → react-native-touchable

AppAndFlow / react-native-touchable

Licence: MIT license
React-Native button helper library

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to react-native-touchable

react-native-radio-buttons-group
Simple, best and easy to use radio buttons for react native apps.
Stars: ✭ 145 (+215.22%)
Mutual labels:  button, react-native-component
vue-clap-button
👍 A Medium like clap button
Stars: ✭ 30 (-34.78%)
Mutual labels:  button
Acebutton
An adjustable, compact, event-driven button library for Arduino that debounces and dispatches events to a user-defined event handler.
Stars: ✭ 180 (+291.3%)
Mutual labels:  button
Cameravideobutton
Instagram like animated button for taking photo or recording video.
Stars: ✭ 223 (+384.78%)
Mutual labels:  button
Easybutton
Arduino library for debouncing momentary contact switches, detect press, release, long press and sequences with event definitions and callbacks.
Stars: ✭ 187 (+306.52%)
Mutual labels:  button
Pygame Menu
Menu for pygame. Simple, lightweight and easy to use
Stars: ✭ 244 (+430.43%)
Mutual labels:  button
Bttn.css
Awesome buttons for awesome projects!
Stars: ✭ 2,004 (+4256.52%)
Mutual labels:  button
vue-github-button
Unofficial github:button component for Vue.js
Stars: ✭ 24 (-47.83%)
Mutual labels:  button
Semantic Ui
Semantic is a UI component framework based around useful principles from natural language.
Stars: ✭ 49,729 (+108006.52%)
Mutual labels:  button
Customfloatingactionbutton
This view is for replacement of standard Floating Action Button from Google Support Library. It is easy to use, customizable and you can also add text to button
Stars: ✭ 222 (+382.61%)
Mutual labels:  button
Loading Buttons Ios
A collection of loading buttons and their stylings written in Swift.
Stars: ✭ 204 (+343.48%)
Mutual labels:  button
Llbootstrapbutton
Bootstrap 3.0扁平化风格按钮,自带图标,一句代码直接调用!!!
Stars: ✭ 189 (+310.87%)
Mutual labels:  button
Separateshapesview
Simple custom ViewGroup with two shapes inside and simple scale animation
Stars: ✭ 250 (+443.48%)
Mutual labels:  button
Lgbutton
A fully customisable subclass of the native UIControl which allows you to create beautiful buttons without writing any line of code.
Stars: ✭ 2,216 (+4717.39%)
Mutual labels:  button
ShapeView
打造万能shape,再也不用写很多xml了,可以当做TextView,Button,EditText等多种控件,方便实用
Stars: ✭ 34 (-26.09%)
Mutual labels:  button
Vanilla Back To Top
Simple and smooth Back To Top button
Stars: ✭ 179 (+289.13%)
Mutual labels:  button
Heyui
🎉UI Toolkit for Web, Vue2.0 http://www.heyui.top
Stars: ✭ 2,373 (+5058.7%)
Mutual labels:  button
Fannypack
[UNMAINTAINED] An accessible-focused, themeable, friendly React UI Kit.
Stars: ✭ 245 (+432.61%)
Mutual labels:  button
CameraButton
No description or website provided.
Stars: ✭ 31 (-32.61%)
Mutual labels:  button
unity-button-sounds-editor
Editor extension for Unity game engine. It helps to assign AudioClip to buttons and to play sounds by button clicks.
Stars: ✭ 65 (+41.3%)
Mutual labels:  button

@appandflow/touchable

npm (scoped) Travis branch

A wrapper for react-native Touchable components to simplify the API and make the Android ripple effect work by default. Based on react-native-gesture-handler.

Why use this library?

It lets you import only component and forget about which platform you are using, it will default to the best behavior for the platform.

Installation

yarn add @appandflow/touchable

Usage

import Touchable from '@appandflow/touchable';

If you are using things like ScrollView make sure to use the one included in react-native-gesture-handler for better interactions.

Props

feedback

  • opacity
  • highlight
  • none

disabled

You can disable the touch by passing disabled true. Default false.

native [Android only]

TODO: This doesn't work anymore as of V2

Toggle whether or not to use the ripple effects on Android. By default this is true on Android.

If false don't forget to add a feedback

History

v2.0.0

  • This version now uses react-native-gesture-handler. If you are using Expo it is included by default, otherwise you will need to install it. For a version that uses RN primitives use @^1.0.0.

  • native={false} is not currently implemented.

  • onLongPress is no longer supported, use LongPressGestureHandler from react-native-gesture-handler instead.

Example

Take a look at example folder. Link

import React, { Component } from 'react';
import { Text, View, Alert } from 'react-native';
import Touchable from '@appandflow/touchable';

class App extends Component {
  _handleAlert = feedback => {
    Alert.alert(`You touch the feedback: ${feedback}`);
  };
  render() {
    return (
      <View style={styles.container}>
        <Touchable
          feedback="opacity"
          style={[styles.button, styles.opacity]}
          onPress={() => this._handleAlert('opacity')}
        >
          <Text style={styles.buttonText}>OPACITY</Text>
        </Touchable>
        <Touchable
          feedback="highlight"
          style={[styles.button, styles.highlight]}
          onPress={() => this._handleAlert('highlight')}
        >
          <Text style={styles.buttonText}>HIGHLIGHT</Text>
        </Touchable>
        <Touchable
          feedback="none"
          style={[styles.button, styles.none]}
          onPress={() => this._handleAlert('none')}
        >
          <Text style={styles.buttonText}>NONE</Text>
        </Touchable>
      </View>
    );
  }
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].