Show a view on top of all the views (including native modals). It can be used like an overlay view.
npm install react-native-z-view react-native-screens
Note: react-native-screens is required for iOS.
import { ZView } from 'react-native-z-view'
<ZView>
<View>
<Text>This will be shown on top of all the views!<Text>
</View>
</ZView>
top
- To adjust top value. Similar to top
in position fixed. Accepts percentage and point values.left
- To adjust left value. Similar to left
in position fixed. Accepts percentage and point values.bottom
- To adjust bottom value. Similar to bottom
in position fixed. Accepts percentage and point values.right
- To adjust right value. Similar to right
in position fixed. Accepts percentage and point values.touchable
(default: true
) - Setting it to false makes the entire ZView non-touchable which allows passing touch events to the behind view of ZView itself.<ZView top={10} left={40}>
<View>
<Text>This will be shown on top of all the views!<Text>
</View>
</ZView>
import { Dimensions } from 'react-native'
const { width, height } = Dimensions.get('screen')
<ZView>
<View
style={{
width,
height,
backgroundColor: 'rgba(0, 0, 0, 0.5)'
}}
>
<Text>Full size overlay view</Text>
</View>
</ZView>
See the contributing guide to learn how to contribute to the repository and the development workflow.
MIT
Made with create-react-native-library