Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-native-gradient-texts

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-gradient-texts

React Native component for different Gradient styled Texts for iOS & Android.

  • 0.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

react-native-gradient-texts

NPM package version NPM package downloads License

About

react-native-gradient-texts is React Native component for different Gradient styled Texts for iOS & Android.


Installation

  1. Install library

    from npm

    npm install react-native-gradient-texts
    

    from yarn

    yarn add react-native-gradient-texts
    
  • Make sure that you have installed the react-native-svg libarary.
  1. Link native code

    cd ios && pod install
    

Example


  1. Gradient Text with Gradient Border
import React from "react";
import { StyleSheet, SafeAreaView } from "react-native";
import GradientText from "react-native-gradient-texts";

const App = () => {
  return (
    <SafeAreaView style={styles.container}>
      <GradientText
        text={"GRADIENT TEXT"}
        fontSize={40}
        isGradientFill
        isGradientStroke
        strokeWidth={2}
        style={{ backgroundColor: "black" }}
        width={420}
        locations={{ x: 210, y: 65 }}
        borderColors={["#adfda2", "#11d3f3"]}
        gradientColors={["#6710c2", "#c81d77"]}
        fontFamily={"Gill Sans"}
      />
    </SafeAreaView>
  );
};

export default App;

const styles = StyleSheet.create({
  container: {
    flex: 1,
    alignItems: "center",
    justifyContent: "center",
  },
});
  1. Gradient Stroke Text
<GradientText
    text={'GRADIENT STROKE'}
    fontSize={35}
    isGradientStroke
    width={420}
    locations={{x: 210, y: 65}}
    strokeWidth={1.2}
    fontFamily={'Rockwell'}
/>
<GradientText
    text={'GRADIENT STROKE'}
    fontSize={40}
    style={{backgroundColor: 'black'}}
    isGradientStroke
    strokeWidth={2}
    width={420}
    locations={{x: 210, y: 65}}
    borderColors={['#b429f9', '#fdbb2d']}
/>
  1. Bordered Text
<GradientText
  text={"STROKED TEXT"}
  fontSize={50}
  fillColor={"#fdbb2d"}
  width={420}
  locations={{ x: 210, y: 75 }}
  strokeWidth={1.5}
  strokeColor={"#22c1c3"}
  fontFamily={"Marker Felt"}
/>
  1. Simple Gradient Text
<GradientText
  text={"GRADIENT TEXT"}
  fontSize={45}
  width={420}
  locations={{ x: 210, y: 65 }}
  isGradientFill
  gradientColors={["#22c1c3", "#fdbb2d"]}
/>

Props

PropsParams TypeDefaultDescription
text (Required)String''Text to be display
heightNumber100SVG height
widthNumber300SVG width
gradientColors[String, String]['#810955', '#533483']Colors for text Gradient
borderColors[String, String]['#b429f9', '#26c5f3']Colors for text Border/Stroke
locations{x: Number; y: Number}{x: 150, y: 80}Distance on x, y axis
start{x: Number; y: Number}{x: 0, y: 0}Start of the gradient on the x, y axis
end{x: Number; y: Number}{x: 1, y: 1}End of the gradient on the x, y axis
isGradientFillBooleanfalseFor gradient text
fillColorString'#FFFFFF'For single colored text
isGradientStrokeBooleanfalseFor gradient Text Border
strokeColorString'#000000'For simple text border
strokeWidthNumber0Text border Width
fontSizeNumber18Customize font size
fontFamilyString'Avenir Next'Customize font family
fontWeightString or Number900Customize font weight
styleViewStyle{}Styling for container view

Author

Drashti Sabhaya


License

This project is under the MIT license. See the LICENSE to learn more.
Contact!

Keywords

FAQs

Package last updated on 17 Sep 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc