SkillAgentSearch skills...

Toast

šŸž An accessible and beautiful notification library for React.

Install / Use

/learn @pheralb/Toast

README

<div align="center"> <a href="https://toast.pheralb.dev"> <img src="https://toast.pheralb.dev/images/logo_svg.svg" alt="@pheralb/toast" height="60" /> </a> <p /> <p> <b> An accessible notification library for React. </b> </p>

<a href="https://toast.pheralb.dev/">Documentation</a> <span>  ✦  </span> <a href="https://toast.pheralb.dev/#getting-started">Getting Started</a> <span>  ✦  </span> <a href="#-contributing">Contribute</a> <span>  ✦  </span> <a href="#-roadmap">Roadmap</a> <span>  ✦  </span> <a href="#-license">License</a>

</div> <div align="center">

React Badge Next.js Badge Vitest Badge GitHub releases npm bundle size Build Status GitHub stars GitHub issues

</div>

🪐 Features

  • [x] šŸ‚ Lightweight.
  • [x] āœ… Accessible.
  • [x] šŸŽØ Light, dark & system theme mode.
  • [x] ā²ļø Don't close automatically when the user hover over the toast.
  • [x] šŸ—ļø Customizable toast position.
  • [x] šŸƒ Disable transitions if the user has disabled them in the system.
  • [x] šŸ’™ Built completely with Typescript.

✨ Inspiration

šŸš€ Getting Started

[!IMPORTANT] This library requires React v18 or higher.

  1. Install the library:
# Using npm:
npm install @pheralb/toast

# Using pnpm:
pnpm add @pheralb/toast

# Using yarn:
yarn install @pheralb/toast
  1. Add the toast provider:
// šŸ“ƒ root.tsx

import { Toaster } from "@pheralb/toast";

ReactDOM.createRoot(document.getElementById("root")!).render(
  <React.StrictMode>
    <App />
    <Toaster />
  </React.StrictMode>,
);
  1. Usage:
// šŸ“ƒ index.tsx

import { toast } from "@pheralb/toast";

export default function Index() {
  return (
    <>
      <button
        onClick={() =>
          toast.success({
            text: "pheralb/toast",
            description: "✨ A beautiful toast library for React",
          })
        }
      >
        <span>Render a toast</span>
      </button>
    </>
  );
}

[!TIP] šŸ“š Visit the Documentation for more information.

šŸ”­ Roadmap

  • [x] šŸš— Add .loading variant.
  • [x] šŸ“š Add support for Astro + React.
  • [x] ✨ Export bundled & minified .css file.
  • [x] šŸŽØ Add support to customize the default styles for greater flexibility and adaptability.

šŸ¤ Contributing

pheralb/toast is a monorepo built with Turbo and it uses:

  • Website: Next.js 15 + Content-Collections + MDX + shadcn/ui + Lucide + React-Symbols.
  • Library: React 19 with tsup + Lightning CSS + Vitest for testing.
  1. Click here to fork the repository.

  2. Install dependencies:

# Install pnpm globally if you don't have it:
npm install -g pnpm

# and install dependencies:
pnpm install
  1. Commands:
# Run only documentation website:
pnpm dev:docs

# Run all website + packages:
pnpm dev

# Build the docs & library:
pnpm build

# Test the library:
pnpm test

šŸ§‘ā€šŸš€ Open http://localhost:3000 to view the Next.js documentation website.

and create a pull request with your features or fixes šŸš€āœØ.

<a href="https://github.com/pheralb/toast/graphs/contributors"> <img src="https://contrib.rocks/image?repo=pheralb/toast" /> </a>

šŸ“ƒ License

MIT License - pheralb 2024.

View on GitHub
GitHub Stars195
CategoryContent
Updated2d ago
Forks6

Languages

TypeScript

Security Score

100/100

Audited on Apr 2, 2026

No findings