Security News
Combatting Alert Fatigue by Prioritizing Malicious Intent
In 2023, data breaches surged 78% from zero-day and supply chain attacks, but developers are still buried under alerts that are unable to prevent these threats.
@hortau/masked-view
Advanced tools
React Native MaskedView for iOS and Android.
yarn add @react-native-masked-view/masked-view
or
npm install --save @react-native-masked-view/masked-view
Linking the package manually is not required anymore with Autolinking.
iOS Platform:
npx pod-install
You then need to link the native parts of the library for the platforms you are using. The easiest way to link the library is using the CLI tool by running this command from the root of your project:
react-native link @react-native-masked-view/masked-view
Import the MaskedView
component from @react-native-masked-view/masked-view
and use it like so:
import React from 'react';
import { Text, View } from 'react-native';
import MaskedView from '@react-native-masked-view/masked-view';
export default class App extends React.Component {
render() {
return (
<MaskedView
style={{ flex: 1, flexDirection: 'row', height: '100%' }}
maskElement={
<View
style={{
// Transparent background because mask is based off alpha channel.
backgroundColor: 'transparent',
flex: 1,
justifyContent: 'center',
alignItems: 'center',
}}
>
<Text
style={{
fontSize: 60,
color: 'black',
fontWeight: 'bold',
}}
>
Basic Mask
</Text>
</View>
}
>
{/* Shows behind the mask, you can put anything here, such as an image */}
<View style={{ flex: 1, height: '100%', backgroundColor: '#324376' }} />
<View style={{ flex: 1, height: '100%', backgroundColor: '#F5DD90' }} />
<View style={{ flex: 1, height: '100%', backgroundColor: '#F76C5E' }} />
<View style={{ flex: 1, height: '100%', backgroundColor: '#e1e1e1' }} />
</MaskedView>
);
}
}
The following image demonstrates that you can put almost anything behind the mask. The three examples shown are masked <View>
, <Text>
, and <Image>
.
maskElement
Type | Required |
---|---|
element | Yes |
androidRenderingMode
By default hardware
rendering mode will be used for best performance, however if you need to animate your maskElement
then you’ll need to switch to software
to get your mask to update. This prop only affects Android.
Type | Required | Default |
---|---|---|
software , hardware | No | hardware |
FAQs
React Native MaskedView component
The npm package @hortau/masked-view receives a total of 0 weekly downloads. As such, @hortau/masked-view popularity was classified as not popular.
We found that @hortau/masked-view demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 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.
Security News
In 2023, data breaches surged 78% from zero-day and supply chain attacks, but developers are still buried under alerts that are unable to prevent these threats.
Security News
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
Security News
License exceptions modify the terms of open source licenses, impacting how software can be used, modified, and distributed. Developers should be aware of the legal implications of these exceptions.