
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-gradient-wrapper
Advanced tools
A flexible React Native gradient wrapper component with animated border and background gradients.
GradientWrapper is a flexible, animated wrapper component for React Native that adds background and border gradients with support for animations, angle directions, theming, and per-side customization. It’s designed to be beginner-friendly while still powerful enough for advanced use cases.
stopBackgroundAfter
, stopBorderAfter
)Install peer dependencies first:
npm install react-native-gradient-wrapper react-native-linear-gradient
If you're using Expo, install the linear gradient library with:
npx expo install react-native-gradient-wrapper expo-linear-gradient
Expo will automatically handle linking and compatibility.
import { GradientWrapper } from 'react-native-gradient-wrapper';
<GradientWrapper
borderGradient={['rgba(0, 0, 255, 0.9)', 'rgba(186, 0, 146, 0.97)']}
borderRadius={30}
stopBorderAfter={300000} // stop after 30 sec
borderAngle={46.38} // instead of start and end X,Y you can use angle
borderWidth={2}
contentStyle={{
height: 35,
width: '100%',
alignItems: 'center',
alignContent: 'center',
flex: 1,
padding: 10,
}}
style={{ margin: 0 }}
enableFeedback
backgroundGradient={['rgb(155, 70, 0)', 'rgb(50, 0, 56)']}
backgroundLocations={[0, 0.6, 1]}
angle={90} // angle for background color
>
<TouchableOpacity onPress={() => setSpeed(prev => Math.max(1000, prev - 500))}>
<Text style={{ color: '#FFFFFF' }}>Animated Border Button</Text>
</TouchableOpacity>
</GradientWrapper>
import { GradientWrapper } from 'react-native-gradient-wrapper';
<GradientWrapper
backgroundGradient={['#5A3F37', '#2C7744', '#5A3F37']}
backgroundRotationSpeed={4000}
animated={true} //color rotation
style={styles.container}
borderWidth={0}
angle={46.36}
// backgroundLocations={[0,0.5, 1]}//for background location
borderRadius={0}
>
<View style={styles.content}>
<Text style={styles.title}>Animated Background Gradient</Text>
</View>
</GradientWrapper>
Prop | Type | Description |
---|---|---|
backgroundGradient | string[] | Background color array |
borderGradient | string[] | Border color array (fallback if no sides defined) |
borderTopGradient | string[] | Top border only |
borderBottomGradient | string[] | Bottom border only |
borderLeftGradient | string[] | Left border only |
borderRightGradient | string[] | Right border only |
borderWidth | number | Width of the border (default 2 ) |
borderRadius | number | Corner radius (default 10 ) |
backgroundRotation | 'clockwise' | 'anticlockwise' | 'none' | Rotating background effect |
borderRotation | 'clockwise' | 'anticlockwise' | 'none' | Rotating border effect |
backgroundRotationSpeed | number | Milliseconds for one background rotation cycle |
borderRotationSpeed | number | Milliseconds for one border rotation cycle |
stopBackgroundAfter | number | Stops background animation after X ms |
stopBorderAfter | number | Stops border animation after X ms |
animated | boolean | Animate colors across gradient stops |
angle | number | Direction in degrees (e.g. 45 ) for background |
borderAngle | number | Direction in degrees for border gradient |
theme | 'light' | 'dark' | 'auto' | Theme-based fallback gradient colors |
onPress , onLongPress | () => void | Press handlers |
enableFeedback | boolean | Scale animation on press (default true ) |
Feature / Library | react-native-gradient-wrapper | react-native-linear-gradient | react-native-gradients | react-native-animated-linear-gradient |
---|---|---|---|---|
✅ Background gradient support | ✅ | ✅ | ✅ | ✅ |
✅ Border gradient | ✅ | ❌ | ❌ | ❌ |
✅ Animated color transition (morph) | ✅ | ❌ | ❌ | ✅ (only background) |
✅ Rotation animation support | ✅ | ❌ | ❌ | ❌ |
✅ Per-side border control | ✅ | ❌ | ❌ | ❌ |
✅ Theme-aware fallback colors | ✅ | ❌ | ❌ | ❌ |
✅ Pressable feedback (scale) | ✅ | ❌ | ❌ | ❌ |
✅ Angle-based gradient direction | ✅ | ✅ | ✅ | ✅ |
✅ Stop animations after delay | ✅ | ❌ | ❌ | ❌ |
Note:
GradientWrapper
internally usesreact-native-linear-gradient
and extends it with a complete system of wrappers, animations, fallback themes, and UI feedback.
Check src/index.tsx
for all available props and defaults.
MIT
FAQs
A flexible React Native gradient wrapper component with animated border and background gradients.
The npm package react-native-gradient-wrapper receives a total of 40 weekly downloads. As such, react-native-gradient-wrapper popularity was classified as not popular.
We found that react-native-gradient-wrapper demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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.