Package Exports
- react-native-pop-toast
- react-native-pop-toast/package.json
Readme
React Native Pop Toast
React Native Pop Toast is a small library to show quick, animated toast messages in your app. Easy to use and lightweight.
Installation
npm install react-native-pop-toastUsage
App.tsx
import { ToastProvider } from 'react-native-pop-toast';
...
<ToastProvider>
<HomeScreen />
</ToastProvider>
...
HomeScreen.tsx
import { useToast } from 'react-native-pop-toast';
...
const { showToast } = useToast();
return (
<View
style={{
flex: 1,
justifyContent: 'center',
alignItems: 'center',
gap: 5,
}}
>
<Button
title="Success"
onPress={() => showToast('Successful!', 'success')}
/>
<Button
title="Error"
onPress={() => showToast('An error occurred!', 'error')}
/>
<Button title="Info" onPress={() => showToast('Information message')} />
</View>
);License
MIT
Made with create-react-native-library