Overview
A zero-dependency, headless toast notification system for React Native.
NativeToast
NativeToast is a zero-dependency, headless toast notification system for React Native (Expo) with an imperative API, animated SVG icons, stack mode, swipe dismiss, custom icons, and dark/light themes.
Features
- Imperative API — Call
toast.success(),toast.error(), etc. from anywhere, no context or providers needed beyond the container - Animated SVG Icons — Success checkmark and error X-mark drawn with stroke animations
- Stack Mode — Multiple toasts collapse into a visual stack with depth-based scaling; tap to expand
- Swipe to Dismiss — Swipe up on any toast to remove it
- Custom Icons — Pass emojis, icon library elements, or any React node
- Dark & Light Themes — Built-in theme tokens, switchable at runtime
- AppState-Aware Timers — Toast timers pause when the app backgrounds and resume correctly on foreground
- Zero Dependencies — Only peer deps:
react-native-svgandreact-native-safe-area-context
Quick Example
import { toast } from '@ncrft/native-toast';
// Show a success toast
toast.success('Settings saved!');
// Show an error with a custom duration
toast.error('Something went wrong', { duration: 6000 });
// Loading → success/error via promise
toast.promise(
fetch('/api/data'),
{
loading: 'Fetching data…',
success: 'Done!',
error: 'Request failed',
}
);Next Steps
- Install the package and its peer dependencies.
- Quick Start — Wire up the
ToastContainerand fire your first toast. - Explore the Features and API Reference sections.