intergalacticspacehighway / react-native-z-view

Show a View on top of all the views in React Native, like an overlay.
MIT License
141 stars 2 forks source link

react-native-z-view

Show a view on top of all the views (including native modals). It can be used like an overlay view.

Installation

npm install react-native-z-view react-native-screens

Note: react-native-screens is required for iOS.

Usage

import { ZView } from 'react-native-z-view'

<ZView>
  <View>
    <Text>This will be shown on top of all the views!<Text>
  </View>
</ZView>

Props

Examples

Adjust Position

<ZView top={10} left={40}>
  <View>
    <Text>This will be shown on top of all the views!<Text>
  </View>
</ZView>

Full Size Overlay

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>

Why?

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT


Made with create-react-native-library