Coder Social home page Coder Social logo

huangciyin / react-native-gradient-buttons Goto Github PK

View Code? Open in Web Editor NEW

This project forked from radoraykov/react-native-gradient-buttons

0.0 2.0 0.0 696 KB

A lightweight, customizable and haptic Gradient Button component library for React Native ๐ŸŽจ๐Ÿ”˜.

Home Page: https://www.npmjs.com/package/react-native-gradient-buttons

License: MIT License

JavaScript 100.00%

react-native-gradient-buttons's Introduction

React Native Gradient Buttons Tweet

Version Platform License

A lightweight, customizable and haptic Gradient Button library for React Native.

Examples

Requirements

Requires React, React Native, and Expo.

Installation

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

Usage

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

Props

  • style: ViewStyle
    • No default
    • options: any styles you want to apply to the button
  • text: String
    • No default
    • options: any string
  • textStyle: TextSyle
    • No 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

Design+Code Specifc 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"
      textSyle={{ 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 }}
      textSyle={{ fontSize: 20 }}      
      gradientBegin="#874f00"
      gradientEnd="#f5ba57"
      gradientDirection="diagonal"
      height={60}
      width={300}
      radius={15}
      impact
      impactStyle='Light'
      onPressAction={() => alert('You 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 />
  </View>

For a more detailed example, see my example project: React Native Auth Screens.

react-native-gradient-buttons's People

Watchers

James Cloos avatar  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.