0.4.2 • Published 5 years ago

react-native-statusbar-alert-hooks v0.4.2

Weekly downloads
2
License
ISC
Repository
github
Last release
5 years ago

React Native Statusbar Alert

A status bar alert (e.g. in-call, recording, navigating) for React Native

Install

npm install react-native-statusbar-alert-hooks --save or yarn add react-native-statusbar-alert-hooks

Usage

Basic

<StatusBarAlert
  visible={true}
  message="Silent Switch ON"
  backgroundColor="#3CC29E"
  color="white"
/>

Pulse

<StatusBarAlert
  visible={true}
  message="Silent Switch ON"
  backgroundColor="#3CC29E"
  color="white"
  pulse="background"
/>

Press

<StatusBarAlert
  visible={true}
  message="Silent Switch ON"
  backgroundColor="#3CC29E"
  color="white"
  onPress={() => this.navigator.push({id: 'SilentAlert'})}
/>

Children

<StatusBarAlert
  visible={true}
  height={68}
  style={{
    padding: 5
  }}
>
  <Image
    style={{ width: 66, height: 58 }}
    source={{
      uri: 'https://facebook.github.io/react-native/img/header_logo.png'
    }}
  />
</StatusBarAlert>

Props

NameDescriptionRequiredTypeDefault
visibletrue to show, false to hidetrueboolfalse
messagemessage to display in alerttruestring''
onPresscallback on press eventfalsefuncnull
pulseanimate the text or backgroundfalseenum('text','background')false
backgroundColorbackground colorfalsecolor'#3DD84C'
highlightColorcolor on press and pulsefalsecolordarken(this.props.backgroundColor, 0.9)
colortext colorfalsecolor'white'
heightheight of children containerfalseint20
statusbarHeightcustom status bar heightfalseint20
stylestyles for children containerfalsestyle object{}

Usage with react-navigation

See the example directory for a complete example.

Example app

See the example directory for an example React Native app using react-native-statusbar-alert-hooks.