# react-native-toast-message react-native-toast-message is an animated toast notification component for React Native applications. It provides a lightweight (~40 kB), keyboard-aware solution for displaying temporary notification messages with customizable layouts and positioning. The library uses an imperative API, allowing toasts to be triggered from anywhere in the application, including outside of React components. The library offers three built-in toast types (success, error, info) with pre-styled layouts, supports custom toast types, and includes features like auto-hide, swipe-to-dismiss gestures, configurable positioning, and lifecycle callbacks. It manages multiple toast instances through a priority-based ref system, automatically using the most recently mounted Toast component, making it compatible with modals and complex view hierarchies. ## Installation and Basic Setup Install the package and render the Toast component as the last child in your app's root component. ```jsx // Installation // npm install react-native-toast-message // or // yarn add react-native-toast-message // App.jsx import React from 'react'; import { View } from 'react-native'; import Toast from 'react-native-toast-message'; export function App() { return ( {/* Your app content */} ); } ``` ## Showing Toast Messages Display toast notifications imperatively from anywhere in your application using Toast.show() with type, text, and positioning options. ```jsx import React from 'react'; import { Button, View } from 'react-native'; import Toast from 'react-native-toast-message'; export function MyComponent() { const showSuccessToast = () => { Toast.show({ type: 'success', text1: 'Success', text2: 'Your changes have been saved successfully' }); }; const showErrorToast = () => { Toast.show({ type: 'error', text1: 'Error', text2: 'Failed to save changes. Please try again.', position: 'bottom', visibilityTime: 6000, autoHide: true, topOffset: 30, bottomOffset: 40 }); }; const showInfoToast = () => { Toast.show({ type: 'info', text1: 'Information', text2: 'Processing your request...' }); }; return (