1.6.0 • Published 1 month ago

react-native-app-notification v1.6.0

Weekly downloads
2
License
ISC
Repository
github
Last release
1 month ago

react-native-app-notification

A gif showing react-native-app-notification

Content

Installation

npm i react-native-app-notification

Setup

Inside of App.tsx

import AppNotification from 'react-native-app-notification'

const App = () => {
  return (
    <View>
      (...)
      <AppNotification />
    </View>
  )
}

Example

// Anywhere in the app
AppNotification.show({
  title: 'New message'
  message: 'Someone sent you a message!',
  onPress: navigateToMessages,
})

// You can inject your own components to extend it further
AppNotification.show({
  title: 'New message'
  message: 'Someone sent you a message!',
  left: <NotificationIcon />,
  right: <ShowButton />,
})

AppNotification Component Props

PropertyTypeOptionalDefaultDescription
animatedbooleantruetrueDetermines if the notification should animate in/out
durationnumbertrue5000Lifetime in MS
renderNotificationfunctiontrue undefinedOverrides notification renderring
maxAmountnumbertrue undefinedSets amount of notifications that can be active at once
alignBottombooleantruefalseRenders the notifications from the bottom
bottomOffsetnumbertruelayout.height * 0.07Bottom offset
topOffsetnumbertruelayout.height * 0.07Top offset
contentContainerStyleStyleProptrue{ marginLeft: 8, width: 85%}Stylesheet for the View renderring all the notifications
containerStyleStyleProptrueSEE SOURCEStylesheet for the notification card
titleStyleStyleProptrueSEE SOURCEStylesheet for the title
messageStyleStyleProptrueSEE SOURCEStylesheet for the messagee
imageStyleStyleProptrueSEE SOURCEStylesheet for the image

Methods

MethodDescriptionProps
show(options)Renders a notificationtitle, message, imageUrl, onPress, panEnabled, left, right (and everything above except for contentContainerStyle)
clear()Clears all notificationsnone
1.5.2

1 month ago

1.6.0

1 month ago

1.5.1

2 months ago

1.5.0

1 year ago

1.4.3

3 years ago

1.4.2

3 years ago

1.4.1

3 years ago

1.4.0

3 years ago

1.3.0

4 years ago

1.2.0

4 years ago

1.1.0

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago