Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
S

sonner-native-toasts

> 前端框架
Open source

An opinionated toast component for React Native. A port of @emilkowalski's sonner.

1.3K stars0 likes0 views
WebsiteGitHub

About

An opinionated toast component for React Native. A port of @emilkowalski's sonner.

React Native Toasts

An opinionated toast component for React Native. A port of @emilkowalski's sonner.

Features

  • API fully matches Sonner's
  • Multiple variants, including success, error, warning, custom, promise
  • Promise variant with built-in loading state
  • Custom JSX with the custom variant
  • Top, bottom, or center positions
  • Title and description
  • Action button with a callback
  • Custom icons
  • Optionally dismissable with swipe, configurable left or up
  • Dismissable with toast.dismiss(), one or all toasts
  • Highly performant using Reanimated 3, 60 FPS
  • Dark mode built-in
  • Works with Expo
  • NativeWind supported
  • Customizable via styles props
  • Works outside of React components

Showcase

Expo Snack

https://snack.expo.dev/@gunnartorfis/sonner-native

Installation

bash
npx expo install sonner-native

Requirements

To use this package, you also need to install its peer dependencies. Check out their documentation for more information:

  • React Native Reanimated
  • React Native Gesture Handler
  • React Native Safe Area Context
  • React Native SVG
  • React Native Screens
  • React Native Worklets

Usage

In your App.tsx/entry point

typescript
import { Toaster } from 'sonner-native';

function App() {
  return (
    
      ...
      
    
  );
}

With Expo Router

When using Expo Router, place the Toaster component in your root layout file (app/_layout.tsx):

typescript
import { Toaster } from 'sonner-native';
import { Stack } from 'expo-router';
import { GestureHandlerRootView } from "react-native-gesture-handler";

export default function RootLayout() {
  return (
    
      
        
        
      
      
    
  );
}

This ensures the toasts will be displayed across all screens in your app.

Show a toast

typescript
import { toast } from 'sonner-native';

function SomeComponent() {
  return (
     toast('Hello, World!')}
    />
  );
}

Web support

Even though Sonner Native works on the web, it is not recommended to use it there. Instead, use the original Sonner.

The following setup is recommended. Add a sonner.ts and sonner.web.ts file to your project and import from there instead of from this library directly. That way, sonner will be used on the web and sonner-native on native.

typescript
// sonner.ts
export * from 'sonner-native';
typescript
// sonner.web.ts
export * from 'sonner';

Documentation

For more advanced usage, check out the documentation

Recording

https://github.com/user-attachments/assets/ccc428ca-37c3-4589-9e8c-f414c40d764c

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT


Made with create-react-native-library

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

TypeScriptnotificationsreact-nativereact-native-toastsonner

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category前端框架
PricingOpen source

> Related tools

R
React
用于构建用户界面的 JavaScript 库
V
Vue.js
渐进式 JavaScript 框架
N
Next.js
基于 React 的全栈 Web 框架