
Security News
Meet Socket at Black Hat and DEF CON 2025 in Las Vegas
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
react-native-simple-toast
Advanced tools
React Native Toast component for both Android and iOS. It just lets iOS users have the same toast experience as on Android. Using scalessec/Toast on iOS and the React Native's ToastAndroid on Android.
ā supports both old and new architecture (RN >= 0.71 is required for new arch)
ā
extremely simple fire-and-forget api, same as ToastAndroid
ā
renders on top of Modal
s and Alert
s
ā avoids keyboard
ā customizable styling
yarn add react-native-simple-toast
cd ios && pod install
then rebuild your project
the module exposes the following functions, same as ToastAndroid
, with extra configuration parameter for iOS only:
import Toast from 'react-native-simple-toast';
Toast.show(message, duration, options);
Toast.showWithGravity(message, duration, gravity, options);
Toast.showWithGravityAndOffset(
message,
duration,
gravity,
xOffset,
yOffset,
options,
);
exported duration and positioning constants:
import Toast from 'react-native-simple-toast';
Toast.LONG;
Toast.SHORT;
Toast.TOP;
Toast.BOTTOM;
Toast.CENTER;
Please note that yOffset
and xOffset
are ignored on Android 11 and above.
For customizing on iOS, you can pass an object with the following properties:
type OptionsIOS = {
textColor?: ColorValue;
backgroundColor?: ColorValue;
tapToDismissEnabled?: boolean;
};
import Toast from 'react-native-simple-toast';
Toast.show('This is a short toast');
Toast.show('This is a long toast.', Toast.LONG);
Toast.showWithGravity(
'This is a long toast at the top.',
Toast.LONG,
Toast.TOP,
);
Toast.show('This is a styled toast on iOS.', Toast.LONG, {
backgroundColor: 'blue',
});
Toast.show('This is a toast that can be dismissed (iOS only).', Toast.LONG, {
tapToDismissEnabled: true,
});
MIT
Made with create-react-native-library
FAQs
Cross-platform Toast experience for React Native
The npm package react-native-simple-toast receives a total of 27,956 weekly downloads. As such, react-native-simple-toast popularity was classified as popular.
We found that react-native-simple-toast demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago.Ā It has 0 open source maintainers 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
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600Ć faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.