Skip to content

Latest commit

 

History

History
61 lines (45 loc) · 926 Bytes

File metadata and controls

61 lines (45 loc) · 926 Bytes
title Toast
description An accessible and beautiful notification library for React.
category Introduction

Framework guides

Getting Started

  1. Install the library:
  1. Add the toast provider:
// 📃 main.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>
    </>
  );
}