Installations
npm install react-native-image-overlay
Developer Guide
Typescript
No
Module System
CommonJS
Node Version
8.10.0
NPM Version
5.8.0
Score
62.1
Supply Chain
98.7
Quality
74.9
Maintenance
100
Vulnerability
100
License
Contributors
Unable to fetch Contributors
Languages
JavaScript (100%)
Developer
gaddafirusli
Download Statistics
Total Downloads
47,983
Last Day
3
Last Week
41
Last Month
258
Last Year
3,669
GitHub Statistics
86 Stars
26 Commits
23 Forks
1 Watching
1 Branches
1 Contributors
Package Meta Information
Latest Version
0.1.2
Package Id
react-native-image-overlay@0.1.2
Unpacked Size
8.14 kB
Size
3.06 kB
File Count
4
NPM Version
5.8.0
Node Version
8.10.0
Total Downloads
Cumulative downloads
Total Downloads
47,983
Last day
-57.1%
3
Compared to previous day
Last week
-34.9%
41
Compared to previous week
Last month
8.9%
258
Compared to previous month
Last year
-26.2%
3,669
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dependencies
1
React Native ImageBackground
is useful. But you know what's even more useful?
ImageBackground
with overlay. This is exactly it.
Get Started
Installation
1$ npm install --save react-native-image-overlay
Usage
1import ImageOverlay from "react-native-image-overlay"; 2export class MyApp extends Component { 3 render () { 4 return ( 5 <ImageOverlay source={{ uri:"http://example.com/img/cool.jpg" }} /> 6 <ImageOverlay source={require("../../assets/banner.png")} /> 7 ) 8 } 9}
Props
Prop | Description | Type | Default |
---|---|---|---|
blurRadius | The blur radius of the blur filter added to the image | Number | undefined |
containerStyle | Additional styling for the component | ViewStyle | undefined |
contentPosition | Position of title text or child component (if any). | String ("top" ,"center" or "bottom" ) | "center" |
height | The height of the whole component | Number | 300 |
overlayColor | The color to be used for the overlay on top of the image | String | "#000000" |
overlayAlpha | Opacity value of the overlay. From 0 to 1 | Number | 0.5 |
rounded | Value for borderRadius to be applied to the component | Number | undefined |
source | The image source (either a remote URL or a local file resource). | ImageSource | |
title | Text to be displayed over the image | String | undefined |
titleStyle | Additional styling for the title text | TextStyle | undefined |
Example
1. Simple overlay color
The most basic use-case of this module is to add colored overlay on top of your image.
1<ImageOverlay source={{ uri:"http://example.com/img/cool.jpg" }} />
Default overlay is color is #000000
with 0.5
opacity. You can customize it to any color
1<ImageOverlay 2 source={{ uri:"http://example.com/img/cool.jpg" }} 3 overlayColor="cyan" 4 overlayAlpha={0.8} />
2. Overlay with title text
If you want to display a simple white text on top of the image, you can use the title
prop.
1<ImageOverlay 2 source={{ uri:"http://example.com/img/cool.jpg" }} 3 title="This is the title" />
The title will be center
-ed by default. You can move it to the top
or bottom
using the contentPosition
prop
1<ImageOverlay 2 source={{ uri:"http://example.com/img/cool.jpg" }} 3 title="This is the title" 4 contentPosition="bottom" />
Additionally, you can change the styling by passing the titleStyle
along
1<ImageOverlay 2 source={{ uri:"http://example.com/img/cool.jpg" }} 3 title="This is the title" 4 titleStyle={{ color: 'yellow', fontWeight: 'bold' }} />
3. Overlay with child component
You can pass extra components to be displayed on top of your image.
1<ImageOverlay 2 source={{ uri:"http://example.com/img/cool.jpg" }} 3 height={0.7 * height} 4 contentPosition="bottom"> 5 <View> 6 <Image style={styles.avatar} source={{uri:"http://example.com/user/avatar.png"}} /> 7 <Text style={styles.name}>Amelia Edwards</Text> 8 <Text style={styles.location}>Kuala Lumpur, Malaysia</Text> 9 <Button text="Follow me" /> 10 </View> 11</ImageOverlay>
Note: When you are using child component,
title
prop will be ignored.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
5 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-r683-j2x4-v87g
- Warn: Project is vulnerable to: GHSA-662x-fhqg-9p8v
- Warn: Project is vulnerable to: GHSA-394c-5j6w-4xmx
- Warn: Project is vulnerable to: GHSA-78cj-fxph-m83p
- Warn: Project is vulnerable to: GHSA-fhg7-m89q-25r3
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no SAST tool detected
Details
- Warn: no pull requests merged into dev branch
Reason
Found 0/26 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Score
2.4
/10
Last Scanned on 2025-01-06
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn MoreOther packages similar to react-native-image-overlay
react-native-overlay-image
Image overlay with transparent background that hides when you tap outside
react-native-image-overlay-gallery
A react native image overlay component
react-native-image-overlay-prop-types-fixed
Add overlays on top of ImageBackground proptypes commented out due to bug with react-native 0.69.6
react-native-gallery-image-overlay
A react native react native gallery image overlay