Gathering detailed insights and metrics for react-native-toastbox
Gathering detailed insights and metrics for react-native-toastbox
npm install react-native-toastbox
Typescript
Module System
Min. Node Version
Node Version
NPM Version
36.5
Supply Chain
52.2
Quality
65.5
Maintenance
50
Vulnerability
94.4
License
TypeScript (92.41%)
JavaScript (7.59%)
Total Downloads
448
Last Day
1
Last Week
10
Last Month
19
Last Year
97
5 Stars
31 Commits
1 Watching
2 Branches
1 Contributors
Latest Version
0.0.5
Package Id
react-native-toastbox@0.0.5
Unpacked Size
14.26 kB
Size
5.09 kB
File Count
15
NPM Version
9.6.7
Node Version
18.17.1
Publised On
19 Sept 2023
Cumulative downloads
Total Downloads
Last day
-85.7%
1
Compared to previous day
Last week
25%
10
Compared to previous week
Last month
137.5%
19
Compared to previous month
Last year
-72.4%
97
Compared to previous year
5
A toast notification system for React Native applications. This system supports different types of toasts (info
, error
, and success
) and has built-in animations to enhance user experience.
//To do
ToastProvider
To get started, you must wrap the part of your application where you want to display toasts with the ToastProvider
.
1import { ToastProvider } from 'react-native-toastbox'; 2 3function Section() { 4 return ( 5 <ToastProvider> 6 {/* children */} 7 </ToastProvider> 8 ); 9}
Wherever you want to display a toast, use the useToast
hook.
1import { useToast } from './path-to-your-toast-files'; 2 3function MyComponent() { 4 const { showToast, hideToast } = useToast(); 5 6 const handleClick = () => { 7 showToast({ 8 id: 'unique-id', 9 text1: 'This is a toast!', 10 }); 11 }; 12 13 return <Button onClick={handleClick}>Show Toast</Button>; 14}
Modifiable attributes of a toast.
1type Toast = { 2 id: string; 3 type?: 'info' | 'error' | 'success'; 4 text1: string; 5 text2?: string; 6 autoHide?: boolean; 7 visibilityTime?: number; 8 animationConfig?: { 9 duration?: number; 10 tension?: number; 11 friction?: number; 12 }; 13}; 14
We welcome contributions! If you find a bug or want to add a feature, please open an issue or submit a pull request.
MIT
No vulnerabilities found.
No security vulnerabilities found.