
Security News
Crates.io Users Targeted by Phishing Emails
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
react-native-toastier
Advanced tools
A Fully Customizable Toast Component for React Native.
Install the package via npm or yarn
npm install react-native-toastier
or
yarn add react-native-toastier
Wrap your app in ToastProvider to provide context for the toast service.
import { ToastProvider } from 'react-native-toastier'
export default function App() {
return (
<ToastProvider>
<YourApp />
<ToastProvider/>
);
}
Use the ToastService to display a toast message anywhere in the app.
import { ToastService } from 'react-native-toastier';
export default function Component() {
useEffect(() => {
ToastService.show({
message: "Hello Toast"
})
}, []);
// Rest of the code....
}
To show success message
ToastService.show({
message: "Hello Toast"
})
To show error message
ToastService.showError({
message: "Hello Toast"
})
To show info message
ToastService.showInfo({
message: "Hello Toast"
})
To show warning message
ToastService.showWarning({
message: "Hello Toast"
})
ToastService.show({
message: 'Hello',
children: <Custom/>,
textStyle: { color: '#000' },
contentContainerStyle: { borderStartWidth: 5, backgroundColor: '#fff', paddingLeft: 12, flex: 1, borderStartColor: theme.colors.green[300]}
})
Props can be passed from the provider (will apply to all toast) as well as from the toast service (will apply to a particular toast).
Prop | Data type | Default | Description |
---|---|---|---|
children | ReactNode | Required. | The children for context provider. |
theme | Theme | - | Update defualt toast theme. |
animation | string | zoomIn | The animation type to taost message. |
position | string | top | Toast meesage position top, bottom. |
duration | number | 15000 | How long to display the Toast message. |
contentContainerStyle | ViewStyle | - | To update toast message outter container style. |
textContainerStyle | ViewStyle | - | To update toast message container style. |
textStyle | TextStyle | - | To update toast message test style. |
Prop | Data type | Default | Description |
---|---|---|---|
message | string | - | The message to show. |
children | ReactNode | - | The children for custom toast. |
left | ReactNode | - | The left component for a toast. |
right | ReactNode | - | The right component for a toast. |
theme | Theme | - | Update default toast theme for particular toast. |
animation | string | zoomIn | Update animation for particular toast. |
position | string | top | Update position for particular toast. |
duration | number | 15000 | Update duration for particular toast. |
contentContainerStyle | ViewStyle | - | Update outter container style for particulat toast. |
textContainerStyle | ViewStyle | - | Update message container style for particulat toast. |
textStyle | TextStyle | - | Update toast message test style for particulat toast. |
If you find my projects and contributions helpful, consider supporting me. Your support means a lot and helps me continue creating and sharing more cool stuff.
I'm a skilled React and React Native developer ready to help with your project. Let's create something great together! Contact me hardikviradiya27@gmail.com
FAQs
A Fully Customizable Toast Component for React Native.
The npm package react-native-toastier receives a total of 1,231 weekly downloads. As such, react-native-toastier popularity was classified as popular.
We found that react-native-toastier demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.