
Research
/Security News
Critical Vulnerability in NestJS Devtools: Localhost RCE via Sandbox Escape
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
react-native-text-gradient
Advanced tools
React-Native text gradient component for iOS & Android.
$ npm install react-native-text-gradient --save
$ react-native link react-native-text-gradient
If you are using Cocoapods you need to follow the manual installation guide.
Text
component and it is possible to have nested gradients.import { LinearTextGradient } from "react-native-text-gradient";
<LinearTextGradient
style={{ fontWeight: "bold", fontSize: 72 }}
locations={[0, 1]}
colors={["red", "blue"]}
start={{ x: 0, y: 0 }}
end={{ x: 1, y: 0 }}
>
THIS IS TEXT GRADIENT
</LinearTextGradient>;
iOS | Android |
---|---|
![]() | ![]() |
Interface is similar to Text
& LinearGradient
An array of at least two color values that represent gradient colors. Example: ['red', 'blue']
sets gradient from red to blue.
An optional object of the following type: { x: number, y: number }
. Coordinates declare the position that the gradient starts at, as a fraction of the overall size of the gradient, starting from the top left corner. Example: { x: 0.1, y: 0.1 }
means that the gradient will start 10% from the top and 10% from the left.
Same as start, but for the end of the gradient.
An optional array of numbers defining the location of each gradient color stop, mapping to the color with the same index in colors
prop. Example: [0.1, 0.75, 1]
means that first color will take 0% - 10%, second color will take 10% - 75% and finally third color will occupy 75% - 100%.
Optional. If true gradient will be calculated for text view background frame rather than text frame.
<LinearTextGradient
numberOfLines={1}
useViewFrame={true}
locations={[0.5, 0.95]}
// note colors like '#FF000000' are used for seamless transition to transparent
colors={["#FF0000", "#FF000000"]}
start={{ x: 0, y: 0 }}
end={{ x: 1, y: 0 }}
>
%%%%%%%%%%%%%%%%%%%%%%
</LinearTextGradient>
Wait until https://github.com/facebook/react/pull/13211 will be merged or patch react-native to remove failing invariant checks
$ node node_modules/react-native-text-gradient/patch-rn.js
When mixing several text gradients and Text
s top component always should be text gradient.
<LinearTextGradient {...someGradientProps}>
<Text>123</Text>
qwerty
<LinearTextGradient {...anotherGradientProps}>321</LinearTextGradient>
</LinearTextGradient>
This is necessary because only top text component is 'mapped' to actual native node and its children are 'virtual' from the native perspective.
FAQs
Text gradient for React-Native
The npm package react-native-text-gradient receives a total of 516 weekly downloads. As such, react-native-text-gradient popularity was classified as not popular.
We found that react-native-text-gradient demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Research
/Security News
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
Product
Customize license detection with Socket’s new license overlays: gain control, reduce noise, and handle edge cases with precision.
Product
Socket now supports Rust and Cargo, offering package search for all users and experimental SBOM generation for enterprise projects.