npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-native-animatable-button

v1.0.12

Published

[![npm version](https://badge.fury.io/js/react-native-animatable-button.svg)](https://badge.fury.io/js/react-native-animatable-button) ## Installation ``` npm install react-native-animatable-button --save ```

Downloads

1

Readme

react-native-animatable-button

npm version

Installation

npm install react-native-animatable-button --save

Overview

  • [x] States
  • [x] Opacity animation
  • [x] Tap animations
  • [x] Fully customizable

Props

Button Props

| Props | Type | Description | Required | Default | |:---------------------|:----------------------------|:-----------------------------------|:-------------|:----------------------------| | accessibilityLabel | string | custom access label | not required | reactNativeAnimetableButton | buttonContainerStyle | Object | must be provided Object not STYLE | not required | see below | selectedState | string | selected id of provided states | not required | default | states | [key: string]: IButtonState | state object | not required | default state | disabled | boolean | enable/disable button | not required | false | touchFeedbaack | boolean | enable/disable tap opacity animate | not required | true | touchFeedbaackDelay | boolean | set delayPressIn prop of TOpacity | not required | 0

Button Animation Props

| Props | Type | Description | Required | Default | |:---------------------------|:----------------------------|:-----------------------------------|:-------------|:----------------------------------| | animationDelay | number | delay of animations | not required | 0 | animationDuration | number | animation duration time | not required | 400 | animationEasing | EasingFunction | easing options | not required | Easing.bezier(0.4, 0.2, 0.4, 1.3) | onPressAnimationEnable | boolean | tap animation config | not required | true | onPressAnimationScaleValue | number | number of scale to | not required | 1.05 | onPressAnimationType | button - inside | scale all button or inside | not required | button | startAnimationDelay | number | delay of start animation | not required | 0 | startAnimationDuration | number | animation duration time for start | not required | 400 | startAnimationEnable | boolean | enable/disable start animation | not required | true | backgroundAnimation | animated - slide | set background option | not required | animated

Button State Props

| Props | Type | Description | Required | Default | |:------------------------------|:----------------------------|:-----------------------------------|:-------------|:----------------------------------| | buttonInsideContainerStyle | Object | must be provided Object not STYLE | not required | see below | icon | ImageURISource - any | icon uri or source | not required | - | iconStyle | ImageStyle | icon style | not required | see below | iconPosition | left - right | position of icon | not required | left | text | string | button text | not required | - | textStyle | TextStyle | text style | not required | see below | spinner | boolean | enable/disable spinner | not required | false | spinnerProps | ActivityIndicatorProperties | spinner Props | not required | - | syncIconAndTextAnimation | boolean | enable/disable animation diff | not required | false | asyncIconAndTextAnimationDiff | number [0 - 100] | percent of diff | not required | 50

buttonContainerStyle

{
  backgroundColor: 'rgba(0,0,0,0)',
  borderRadius: 5,
  borderWidth: 1,
  height: ButtonSize.height,
  overflow: 'hidden'
}

buttonInsideContainerStyle

{
  alignItems: 'center',
  backgroundColor: 'rgba(0,0,0,0)',
  flexDirection: 'row',
  height: ButtonSize.height,
  justifyContent: 'center',
  overflow: 'hidden',
  paddingHorizontal: 10
}

textStyle

{
  paddingHorizontal: 5
}

iconStyle

{
  flex: 1,
  resizeMode: 'contain'
}

Note

Master props and state props are combined when provided.

Usage example

constructor() {
  super();

  this.state = {
  activeState: 'idle2'
  }
}

render () {
  <Button	
    touchFeedback={false}
    onPress={this.onPress.bind(this)}
    selectedState={this.state.activeState}
    buttonContainerStyle={{
      height: 40
    }}
    buttonInsideContainerStyle={{
      backgroundColor: 'rgba(100,100,100,0.5)'
    }}
    onPress={() => { 
      console.log('master pressed');
      if (this.state.activeState === 'idle2') this.setState({ activeState: 'idle' });	
    }}
    states={{
      laodList: {
        text:"Load List",
        buttonInsideContainerStyle:{
          backgroundColor: 'rgba(255,0,0,0.5)'
        },
        onPress: () => { 
          console.log('loadList pressed'); 
          this.setState({ activeState: 'loading' })
          
          return false; 
        }
      },
      // when tap laodList logs => loadList pressed; master pressed

      loading: {
        text:"loading",
        buttonInsideContainerStyle:{
          backgroundColor: 'rgba(0,255,0,0.5)'
        },
        spinner: true,
        onPress: () => { console.log('loading pressed'); return true; }
      },
      // when tap loading logs => loading pressed;

      idle: {
        text:"idle",
        onPress: () => { 
          console.log('idle pressed');
          this.setState({ activeState: 'loadList' })
        }
      },
      // when tap idle logs => idle pressed; master pressed

      idle2: {
        text:"idle2",
      }
      // when tap idle2 logs => master pressed
    }}
  />
}

Description

if you are return false or undefined in sub onPress functions when call master onPress function.