Native Toast

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-svg and react-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

  1. Install the package and its peer dependencies.
  2. Quick Start — Wire up the ToastContainer and fire your first toast.
  3. Explore the Features and API Reference sections.

On this page