
Security News
Another Round of TEA Protocol Spam Floods npm, But It’s Not a Worm
Recent coverage mislabels the latest TEA protocol spam as a worm. Here’s what’s actually happening.
rn-snap-toast
Advanced tools
A modern, customizable toast component for Expo with beautiful blur effects, smooth animations, and a powerful queue system.
A modern, customizable toast component for Expo with beautiful blur effects, smooth animations, and a powerful queue system.
This package is designed specifically for Expo projects. Make sure you have an Expo project set up.
npm install rn-snap-toast
# or
yarn add rn-snap-toast
This library requires the following Expo dependencies:
npx expo install expo-blur react-native-reanimated react-native-screens react-native-svg
Note: This package is Expo-only and requires Expo's managed workflow or development builds. It is not compatible with bare React Native projects.
import { ToastProvider } from 'rn-snap-toast';
export default function App() {
return (
<ToastProvider
config={{
duration: 2000,
maxQueueSize: 5,
animationDuration: 2000,
blurIntensity: 70,
blurType: 'dark',
position: 'bottom',
insets: {
top: 24,
bottom: 32,
},
textStyle: {
color: 'white',
fontSize: 14,
fontWeight: '500',
},
}}
>
{/* Your app content */}
</ToastProvider>
);
}
import { useToast } from 'rn-snap-toast';
function MyComponent() {
const { showToast } = useToast();
const handleShowToast = () => {
showToast({
message: 'Hello, this is a toast message!',
duration: 3000,
position: 'bottom',
});
};
return (
<Button title="Show Toast" onPress={handleShowToast} />
);
}
The main provider component that wraps your app and provides toast functionality.
interface ToastConfig {
duration?: number; // Default: 2000ms
maxQueueSize?: number; // Default: 10
animationDuration?: number; // Default: 2000ms
blurIntensity?: number; // Default: 70
blurType?: 'light' | 'dark' | 'default'; // Default: 'dark'
disableBlur?: boolean; // Default: false
blurFallbackColor?: string; // Fallback color when blur is disabled
backdropColor?: string; // Background color for the toast
borderRadius?: number; // Border radius for the toast container
position?: 'top' | 'bottom'; // Default: 'bottom'
insets?: {
top: number; // Default: 0
bottom: number; // Default: 0
};
textStyle?: TextStyle; // Default: undefined (uses default styles)
toastView?: React.ReactNode; // Custom toast view component
}
Returns the toast context with methods to show and hide toasts.
const { showToast, hideToast, config, toastParams } = useToast();
Displays a toast message with the specified configuration.
interface ToastParams {
message: string; // Required: The message to display
duration?: number; // Optional: Duration in milliseconds
isSuccess?: boolean; // Optional: Show success tick icon
isActionable?: boolean; // Optional: Enable action button
buttonText?: string; // Optional: Text for action button
position?: 'top' | 'bottom'; // Optional: Toast position
toastView?: React.ReactNode; // Optional: Custom toast view component
onButtonPress?: () => void; // Optional: Action button callback
onFinish?: () => void; // Optional: Called when toast finishes
}
const { showToast } = useToast();
showToast({
message: 'This is a simple toast message',
});
showToast({
message: 'Operation completed successfully!',
isSuccess: true,
duration: 4000,
});
showToast({
message: 'Do you want to undo this action?',
isActionable: true,
buttonText: 'Undo',
onButtonPress: () => {
// Handle undo action
console.log('Undo pressed');
},
});
showToast({
message: 'This toast appears at the top',
position: 'top',
});
showToast({
message: 'This toast will show for 5 seconds',
duration: 5000,
});
showToast({
message: 'Custom styled toast',
toastView: (
<View style={{ padding: 20, backgroundColor: 'purple' }}>
<Text style={{ color: 'white' }}>Custom Content</Text>
</View>
),
});
showToast({
message: 'Processing your request...',
onFinish: () => {
console.log('Toast finished');
},
});
// In ToastProvider config
<ToastProvider
config={{
textStyle: {
color: 'white',
fontSize: 16,
fontWeight: '600',
},
}}
>
{/* Your app */}
</ToastProvider>
You can provide a completely custom toast view component:
// In ToastProvider config
<ToastProvider
config={{
toastView: <CustomToastComponent />,
}}
>
{/* Your app */}
</ToastProvider>
// Or per-toast
showToast({
message: 'Custom toast',
toastView: <MyCustomView />,
});
If you want to disable the blur effect and use a solid background:
<ToastProvider
config={{
disableBlur: true,
blurFallbackColor: 'rgba(0, 0, 0, 0.8)',
backdropColor: 'rgba(0, 0, 0, 0.9)',
}}
>
{/* Your app */}
</ToastProvider>
<ToastProvider
config={{
borderRadius: 20, // Custom border radius
}}
>
{/* Your app */}
</ToastProvider>
<ToastProvider
config={{
// Toast duration in milliseconds
duration: 2000,
// Maximum number of toasts in queue
maxQueueSize: 5,
// Animation duration in milliseconds
animationDuration: 2000,
// Blur effect intensity (0-100)
blurIntensity: 70,
// Blur effect type
blurType: 'dark', // 'light' | 'dark' | 'default'
// Disable blur effect
disableBlur: false,
// Fallback color when blur is disabled
blurFallbackColor: 'rgba(0, 0, 0, 0.8)',
// Background color for the toast
backdropColor: 'rgba(0, 0, 0, 0.9)',
// Border radius for the toast container
borderRadius: 12,
// Default position for toasts
position: 'bottom', // 'top' | 'bottom'
// Safe area insets
insets: {
top: 24,
bottom: 32,
},
// Custom text styling
textStyle: {
color: 'white',
fontSize: 14,
fontWeight: '500',
},
// Custom toast view component
toastView: undefined,
}}
>
{/* Your app */}
</ToastProvider>
The toast component uses a modern design with:
Toasts can be positioned at the top or bottom of the screen with configurable safe area insets.
The library includes a powerful queue system that:
You can customize the text appearance using the textStyle property in the ToastProvider config:
textStyle: {
color: 'white',
fontSize: 16,
fontWeight: '600',
fontFamily: 'System',
textAlign: 'center',
}
import { showToast, hideToast } from 'rn-snap-toast';
// Show toast from anywhere in your app
showToast({
message: 'Toast from service',
isSuccess: true,
});
// Hide current toast
hideToast();
The queue system automatically handles multiple toasts:
const { showToast } = useToast();
// These will be queued and shown sequentially
showToast({ message: 'First toast' });
showToast({ message: 'Second toast' });
showToast({ message: 'Third toast' });
You can call toasts from services or utilities outside of React components:
// In a service file
import { showToast } from 'rn-snap-toast';
export const apiService = {
async fetchData() {
try {
const data = await fetch('/api/data');
showToast({
message: 'Data fetched successfully!',
isSuccess: true,
});
return data;
} catch (error) {
showToast({
message: 'Failed to fetch data',
isActionable: true,
buttonText: 'Retry',
onButtonPress: () => this.fetchData(),
});
}
},
};
# Install dependencies
yarn install
# or
npm install
# Run the example app
yarn example
# or
npm run example
# Build the library
yarn build
# or
npm run build
# Type checking
yarn typecheck
# or
npm run typecheck
# Linting
yarn lint
# or
npm run lint
# Fix linting issues
yarn lint:fix
# or
npm run lint:fix
# Run tests
yarn test
# or
npm test
# Run tests in watch mode
yarn test:watch
# or
npm run test:watch
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate and follow the existing code style.
MIT
Made with ❤️ by Ramees P
FAQs
A modern, customizable toast component for Expo with beautiful blur effects, smooth animations, and a powerful queue system.
The npm package rn-snap-toast receives a total of 107 weekly downloads. As such, rn-snap-toast popularity was classified as not popular.
We found that rn-snap-toast 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
Recent coverage mislabels the latest TEA protocol spam as a worm. Here’s what’s actually happening.

Security News
PyPI adds Trusted Publishing support for GitLab Self-Managed as adoption reaches 25% of uploads

Research
/Security News
A malicious Chrome extension posing as an Ethereum wallet steals seed phrases by encoding them into Sui transactions, enabling full wallet takeover.