npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

persian-toaster

v1.0.0

Published

RTL Persian/Farsi toast notifications built on Sonner

Downloads

21

Readme

Persian Toaster

RTL (Right-to-Left) toast notifications for Persian/Farsi apps, built on Sonner.

Installation

npm install persian-toaster sonner
# or
pnpm add persian-toaster sonner
# or
yarn add persian-toaster sonner

Peer dependencies: react (>=18), sonner (>=1.0)

Setup

  1. Add the Toaster to your root layout (from Sonner):
import { Toaster } from "sonner";

export default function Layout({ children }) {
  return (
    <html>
      <body>
        {children}
        <Toaster position="top-center" />
      </body>
    </html>
  );
}
  1. Import the styles in your app (e.g. in layout.tsx or _app.tsx):
import "persian-toaster/styles.css";
  1. Use the toast anywhere in your app:
import { persianToast } from "persian-toaster";

// Success
persianToast.success("عملیات موفق", "اطلاعات با موفقیت ذخیره شد");

// Error
persianToast.error("خطا", "مشکلی پیش آمد");

// Info
persianToast.info("توجه", "لطفاً این مورد را بررسی کنید");

// Warning
persianToast.warning("هشدار", "این عمل قابل بازگشت نیست");

// Loading
persianToast.loading("در حال پردازش...", "لطفاً صبر کنید");

With custom Persian font

Pass fontFamily in options to use your app's Persian font:

persianToast.success("موفق", "ذخیره شد", {
  fontFamily: "var(--font-iran-sans)",
});

Or use persianToast.custom() for full control:

persianToast.custom({
  title: "عنوان",
  description: "توضیحات",
  type: "success",
  fontFamily: "var(--font-iran-sans)",
  action: {
    label: "تأیید",
    onClick: () => console.log("clicked"),
  },
  cancel: {
    label: "انصراف",
    onClick: () => {},
  },
});

Dark mode

Toasts automatically detect dark mode when document.documentElement has the dark class (e.g. html.dark or html class="dark").

API

| Method | Signature | |----------|----------------------------------------------------------| | success | (title, description?, options?) => ToastId | | error | (title, description?, options?) => ToastId | | warning | (title, description?, options?) => ToastId | | info | (title, description?, options?) => ToastId | | loading | (title, description?, options?) => ToastId | | custom | (options: ToastProps) => ToastId |

License

MIT