All Projects → gnestor → React Native Statusbar Alert

gnestor / React Native Statusbar Alert

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

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to React Native Statusbar Alert

Statusbaralert
Telegram X inspired android status bar alert view
Stars: ✭ 214 (-3.17%)
Mutual labels:  alert, statusbar
Uiwidget
一个集成TabLayout、UIAlertDialog、UIActionSheetDialog、UIProgressDialog、TitleBarView(自带沉浸式标题栏)、CollapsingTitleBarLayout、RadiusView(圆角及状态背景设置View解放shape文件)、KeyboardHelper(软键盘控制及遮挡控制类)、StatusViewHelper(状态栏沉浸帮助类)、NavigationViewHelper(导航栏沉浸式帮助类)、AlphaViewHelper(View透明度控制帮助类) 等项目常用UI库
Stars: ✭ 400 (+81%)
Mutual labels:  alert, statusbar
Airpodsbattery Monitor For Mac
Simple Widget to display your AirPods battery levels from the Mac Status bar
Stars: ✭ 165 (-25.34%)
Mutual labels:  statusbar
Awesome Prometheus Alerts
🚨 Collection of Prometheus alerting rules
Stars: ✭ 3,323 (+1403.62%)
Mutual labels:  alert
Sweetalert2
A beautiful, responsive, highly customizable and accessible (WAI-ARIA) replacement for JavaScript's popup boxes. Zero dependencies.
Stars: ✭ 13,929 (+6202.71%)
Mutual labels:  alert
Dwm Bar
A modular statusbar for dwm
Stars: ✭ 171 (-22.62%)
Mutual labels:  statusbar
React Popup
React popup component
Stars: ✭ 198 (-10.41%)
Mutual labels:  alert
Alertifyjs
A javascript framework for developing pretty browser dialogs and notifications.
Stars: ✭ 1,922 (+769.68%)
Mutual labels:  alert
Notica
Send browser notifications from your terminal. No installation. No registration.
Stars: ✭ 215 (-2.71%)
Mutual labels:  alert
Emalertcontroller
EMAlertController is a beautiful alternative to the stock iOS UIAlertController
Stars: ✭ 182 (-17.65%)
Mutual labels:  alert
Wc Messagebox
基于 Vue 2.0 开发的 Alert, Toast, Confirm 插件, UI仿照 iOS 原生
Stars: ✭ 203 (-8.14%)
Mutual labels:  alert
Tfpopup
🚀🚀🚀TFPopup不生产弹框,它只是弹框的弹出工🚀🚀🚀默认支持多种动画方式一行调用,支持完全自定义动画.
Stars: ✭ 182 (-17.65%)
Mutual labels:  alert
Notiflix
Notiflix is a JavaScript library for client-side non-blocking notifications, popup boxes, loading indicators, and more that makes your web projects much better.
Stars: ✭ 172 (-22.17%)
Mutual labels:  alert
Pmalertcontroller
PMAlertController is a great and customizable alert that can substitute UIAlertController
Stars: ✭ 2,397 (+984.62%)
Mutual labels:  alert
Frostmourne
frostmourne是基于Elasticsearch, InfluxDB数据,Mysql数据的监控,报警,分析系统. Monitor & alert & alarm & analyze for Elasticsearch && InfluxDB Log Data。主要使用springboot2 + vue-element-admin。 https://frostmourne-demo.github.io/
Stars: ✭ 166 (-24.89%)
Mutual labels:  alert
Spstorkcontroller
Now playing controller from Apple Music, Mail & Podcasts Apple's apps.
Stars: ✭ 2,494 (+1028.51%)
Mutual labels:  alert
Alerttoast
Create Apple-like alerts & toasts using SwiftUI
Stars: ✭ 151 (-31.67%)
Mutual labels:  alert
Luastatus
universal status bar content generator
Stars: ✭ 195 (-11.76%)
Mutual labels:  statusbar
Jspanel4
A JavaScript library to create highly configurable floating panels, modals, tooltips, hints/notifiers/alerts or contextmenus for use in backend solutions and other web applications.
Stars: ✭ 217 (-1.81%)
Mutual labels:  alert
Scout
可能是东半球最灵活的 URL 监控系统
Stars: ✭ 174 (-21.27%)
Mutual labels:  alert

React Native Statusbar Alert

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

Install

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

Usage

Basic

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

basic

Pulse

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

pulse

Press

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

press

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

Name Description Required Type Default
visible true to show, false to hide true bool false
message message to display in alert true string ''
onPress callback on press event false func null
pulse animate the text or background false enum('text','background') false
backgroundColor background color false color '#3DD84C'
highlightColor color on press and pulse false color darken(this.props.backgroundColor, 0.9)
color text color false color 'white'
height height of children container false int 20
statusbarHeight custom status bar height false int 20
style styles for children container false style object {}

Usage with react-navigation

Create a navigation element using reat-navigation:

import { StackNavigator } from 'react-navigation';
const NavigationStack = StackNavigator({
	Home: {
		screen: HomeScreen
	},
	Child: {
		screen: ChildScreen
	}
});

Render StatusBarAlert adjacent with StatusBar and NavigationStack:

<View style={styles.container}>
  <StatusBar />
  <StatusBarAlert
    visible={this.state.alert}
    message="Alert!"
    onPress={this.toggleAlert}
  />
  <NavigationStack />
</View>

See the ReactNativeStatusBarAlert directory for a complete example.

Alert stack example

Much like a route stack, you can keep an alert stack as an array of alert objects in your component's state. The StatusBarAlert will render the first alert in the stack, so that as new alerts are pushed into the stack, it will render the most recent alert. If an alert is popped from the stack, StatusBarAlert will render any remaining alerts and when the stack is empty, StatusBarAlert will hide itself. Additionally, the object spread operator ({...this.state.alerts[0]}) allows you to declare the default props for alerts in render() (e.g. backgroundColor="#3CC29E") and override those props in the alert object (e.g. backgroundColor="#FF6245").

render() {
  return (
    <View style={styles.container}>
      <StatusBarAlert
        backgroundColor="#3CC29E"
        color="white"
        visible={this.state.alerts.length > 0}
        {...this.state.alerts[0]}
      />
      <Navigator
        initialRoute={initialRoute}
        renderScene={this.renderScene}
        navigationBar={
          <Navigator.NavigationBar
            routeMapper={routeMapper}
            style={{top: -20}}
          />
        }
      />
    </View>
  )
}
showSilentAlert() {
  this.setState({
    alerts: [{
      message: 'Silent Switch ON',
      onPress: () => this.navigator.push({id: 'SilentAlert'}),
      backgroundColor="#FF6245"
    }, ...this.state.alerts]
  })
}
hideSilentAlert() {
  this.setState({
    alerts: this.state.alerts.filter(alert => alert.message !== 'Silent Switch ON')
  })
}

Example app

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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].