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

react-native-linear-gradient-text

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-linear-gradient-text

Component to display text with linear gradient.

  • 1.2.8
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
225
decreased by-17.88%
Maintainers
1
Weekly downloads
 
Created
Source

react-native-linear-gradient-text

NPM package version NPM package downloads GitHub last commit Repository issues size License


About

Component to display text with linear gradient


Installation

Step 1: Install @react-native-masked-view/masked-view library

Make sure that you have installed the @react-native-masked-view/masked-view library:

  • https://github.com/react-native-masked-view/masked-view#getting-started

Step 2: Install react-native-linear-gradient library

Make sure that you have installed the react-native-linear-gradient library:


Getting Started

yarn add react-native-linear-gradient-text
# or
npm install react-native-linear-gradient-text

Usage

import React from 'react';
import { View, StyleSheet } from 'react-native';
import { LinearGradientText } from 'react-native-linear-gradient-text';

export const App = () => {
  return (
    <View style={styles.container}>
      <LinearGradientText
        colors={['#E76F00', '#EA374E']}
        text="Hello World"
        start={{ x: 0.5, y: 0 }}  // Optional
        end={{ x: 1, y: 1 }}  // Optional
        textStyle={{ fontSize: 40 }}  // Optional
        textProps={{ allowFontScaling: true }}  // Optional
      />
    </View>
  );
};

const styles = StyleSheet.create({
  container: {
    flex: 1,
    alignItems: 'center',
    justifyContent: 'center',
  },
});

Props

PropTypeDefaultDescription
textstringRequiredAn string that display text. Example: text="Hello World"
colorsstring[]RequiredAn array of at least two color values that represent gradient colors. Example: colors={["black", "white"]}.
start{ x: number, y: number }{ x: 0.5, y: 0 }An optional prop. He declare the position that the gradient starts. Example start={{ x: 0.5, y: 0 }}.
end{ x: number, y: number }{ x: 1, y: 1 }Same as start, but for the of the gradient.
textStyleTextStyleDefault ValueA property to change all styles that a text has.
textPropsTextPropsDefault ValueA property to apply native props to text.

Author

Henrique Luís Oliveira Marques


Contributors

License

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

Keywords

FAQs

Package last updated on 27 Nov 2023

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