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-gradient-buttons-improved

v3.0.1

Published

React Native gradient buttons for your next project

Downloads

25

Readme

React Native Gradient Buttons Tweet

Version Platform License

Lightweight, customizable and haptic Gradient Buttons for React Native.

Supports press and long press actions.

Requirements

Requires React and React Native.

For pure React Native projects you must install react-native-unimodules as part of Expo's bare workflow.

Installation

yarn add react-native-gradient-buttons
# or
npm install --save react-native-gradient-buttons-improved

Usage

# ES6 import
import GradientButton from 'react-native-gradient-buttons-improved';

Props

  • style: ViewStyle
    • No default
    • options: any styles you want to apply to the button
  • text: String
    • No default
    • options: any string
  • textStyle: TextSyle
    • default: {}
    • options: any styles you want to apply to the text
  • gradientBegin: String
    • default: '#00d2ff'
    • options: Any hex, rgb, or color
  • gradientEnd: String
    • default: '#3a47d5'
    • options: Any hex, rgb, or color
  • gradientDirection: String
    • default: 'horizontal'
    • options: 'horizontal', 'vertical', 'diagonal'
  • height: Number or String (for %)
    • default: 75
    • options: any number
  • width: Number or String (for %)
    • No default
    • options: any number
  • radius: Number
    • default: 50
    • options: any number
  • impact: Boolean
    • default: false
    • options: true or false
  • impactStyle: String
    • default: 'Heavy'
    • options: 'Heavy', 'Medium', 'Light'
  • onPressAction: Function
    • No default
    • options: any function you want to pass to the Gradient Button
  • onLongPressAction: Function
    • No default
    • options: any function you want to pass to the Gradient Button
  • disabled: Boolean
    • default: false
  • disabledGradientBegin: String
    • default: '#D3D3D3'
    • options: Any hex, rgb, or color
  • disabledGradientEnd: String
    • default: '#696969'
    • options: Any hex, rgb, or color

Design+Code Specific Gradient Props

  • purpleViolet
  • violetPink
  • pinkDarkGreen
  • blueViolet
  • blueMarine
  • deepBlue

Examples

  <View style={{flex: 1, justifyContent: 'space-evenly', alignItems: 'center', marginVertical: 24}}>
    <GradientButton
      style={{ marginVertical: 8 }}
      text="Gradient Button #1"
      textStyle={{ fontSize: 20 }}
      gradientBegin="#874f00"
      gradientEnd="#f5ba57"
      gradientDirection="diagonal"
      height={60}
      width={300}
      radius={15}
      impact
      impactStyle='Light'
      onPressAction={() => alert('You pressed me!')}
    />

    <GradientButton
      style={{ marginVertical: 8 }}
      textStyle={{ fontSize: 20 }}
      gradientBegin="#874f00"
      gradientEnd="#f5ba57"
      gradientDirection="diagonal"
      height={60}
      width={300}
      radius={15}
      impact
      impactStyle='Light'
      onPressAction={() => alert('You pressed me!')}
      onLongPressAction={() => alert('You long pressed me!')}
    >
      Gradient Button #2
    </GradientButton>

    <GradientButton text="Purple Violet" width='90%' purpleViolet impact />
    <GradientButton text="Violet Pink" width='90%' violetPink impact />
    <GradientButton text="Pink Dark Green" width='90%' pinkDarkGreen impact />
    <GradientButton text="Blue Violet" width='90%' blueViolet impact />
    <GradientButton text="Blue Marine" width='90%' blueMarine impact />
    <GradientButton text="Deep Blue" width='90%' deepBlue impact />
    <GradientButton text="Disabled" width='90%' disabled impact />
  </View>