パッケージの詳細

react-fox-toast

sanjayc2081.2kMIT1.10.20

This toast for UI which is very flexible to use

react, toast, notifications, notification

readme

fox logo

✨ React Fox Toast✨

Lightweight and customizable toast/notification component for React and Next.js

NPM Version NPM Package Size NPM Package Size
npm
Min Size
Minzip Size

Preview

Description of GIF

React Fox Toast - Flexible Toast Notifications for React and Next.js

react-fox-toast is a lightweight and customizable toast/notification component for React and Next.js. It supports various customization options and integrates seamlessly with libraries like TailwindCSS.

NOTE: Works only on the client side. For SSR frameworks like Next.js, include 'use client'; at the top of your component.

Features

  • Customizable: Adjust position, duration, content, icons, and more.
  • Promise Support: Display success/error messages based on promise results.
  • Custom Content: Render components inside toasts.
  • Global Toast Container: Manage toasts globally.
  • TailwindCSS Support: Easy styling with TailwindCSS.
  • Pause on Hover: Auto-dismiss timer pauses on hover.
  • Expandable Toasts: Click to reveal more content.
  • Global Theme Support: Apply consistent styling across toasts.
  • Lightweight: Minimal performance impact.
  • Smooth Transitions: Includes expand, slide-in, and slide-out animations.

Installation

npm install react-fox-toast
# or
yarn add react-fox-toast
# or
pnpm add react-fox-toast

Usage

1. Add ToastContainer

Wrap your root component with ToastContainer to enable toasts.

'use client'; // Add if using Next.js
import { ToastContainer } from 'react-fox-toast';

function App() {
  return (
    <div>
      <ToastContainer />
    </div>
  );
}

export default App;

2. Use the toast Hook

Call toast functions like toast.success() in your components.

'use client'; // Add if using Next.js
import { toast } from 'react-fox-toast';

function MyComponent() {
  const showToast = () => {
    toast.success('Success! The action was completed.');
  };

  return <button onClick={showToast}>Show Success Toast</button>;
}

Learn More

  • Detailed usage and examples are available in the Documentation.

License

MIT License

For questions or feedback, open an issue or contribute on GitHub!

更新履歴

1.10.20 (2025-03-29)

Bug Fixes

1.10.19 (2025-03-24)

Bug Fixes

  • Now toast.promise can also be awaited (2c40bde)

1.10.18 (2025-03-23)

Bug Fixes

  • remove unused FC ref and comment out an unused useEffect right below it (3221fd2)

1.10.17 (2025-03-23)

Bug Fixes

  • Define types to replace 'any' in options param for toast functions, additional type support. (08e94d1)

1.10.16 (2025-03-20)

Bug Fixes

  • Promises remain in loading state until success or error (4968b55)

1.10.15 (2025-02-23)

Bug Fixes

  • documentation website horizontal scrollbar (7b42bd9)

1.10.14 (2025-02-17)

Bug Fixes

  • Use Goober pseudo-class names for default styling in toast component (abe7c2a)

1.10.13 (2025-02-09)

Bug Fixes

  • homepage domain changed (3848964)

1.10.12 (2025-02-09)

Bug Fixes

  • default aria , domain updated, website changes added accessbility in feature list (85ba9d0)

1.10.11 (2025-02-06)

Bug Fixes

  • added aria as props to ToastContainer (54d046d)

1.10.10 (2025-02-05)

Bug Fixes

1.10.9 (2025-02-05)

Bug Fixes

  • changed default toast example position (4f93390)

1.10.8 (2025-02-05)

Bug Fixes

  • updated toast library version (64207d9)

1.10.7 (2025-02-05)

Bug Fixes

1.10.6 (2025-02-05)

Bug Fixes

1.10.5 (2025-02-05)

Bug Fixes

  • pat check and aria type change (cbf3473)

1.10.4 (2025-02-05)

Bug Fixes

  • username in release and aria props type change (6f0e55d)

1.10.3 (2025-02-05)

Bug Fixes

  • adding aria to the toast container as optional params (b13b112)

1.10.2 (2025-02-03)

Bug Fixes

  • website - added new accessibility page and updated rft version (69937c2)

1.10.1 (2025-02-02)

Bug Fixes

1.10.0 (2025-02-01)

Features

  • aria props for accessibilty with default aria (29ecebc)

1.9.12 (2025-01-31)

Bug Fixes

  • default constants created for ToastContainer (d423af7)

1.9.11 (2025-01-28)

Bug Fixes

  • added icon to Theming for all types (a6dcacd)

1.9.10 (2025-01-27)

Bug Fixes

  • removed closeButtonClassName variable not requried (a910318)

1.9.9 (2025-01-27)

Bug Fixes

  • changed id position for new toast types (e729fbd)

1.9.8 (2025-01-26)

Bug Fixes

  • multiple times envelope clicked cause ficker fixed with condition (6137513)

1.9.7 (2025-01-26)

Bug Fixes

  • added quick ref to all pages (70273f5)
  • header fixed with blur effect on scroll (e39bd0c)

1.9.6 (2025-01-25)

Bug Fixes

1.9.5 (2025-01-25)

Bug Fixes

1.9.4 (2025-01-24)

Bug Fixes

  • added drawer-toast page to sidebar (eb2224f)

1.9.3 (2025-01-24)

Bug Fixes

  • website changes created drawer doc page (5fab6ec)

1.9.2 (2025-01-23)

Bug Fixes

  • website changes drawer button with demo code added to home page (f387d6d)

1.9.1 (2025-01-23)

Bug Fixes

  • default icon for drawer added (229e7b9)

1.9.0 (2025-01-23)

Features

  • new type drawer with expand and collapse functionality (60226e1)

1.8.8 (2025-01-22)

Bug Fixes

  • now all pages mdx created and will be found in search (c309340)
  • removed unwatned req and res from doc api (bcc19d5)

1.8.7 (2025-01-21)

Bug Fixes

  • created searchbar with toast mdx's required to search (de2ac77)
  • eslint fixed for search utils (123583d)

1.8.6 (2025-01-20)

Bug Fixes

  • added github link to the header for doc (083b99f)

1.8.5 (2025-01-20)

Bug Fixes

  • rft version updated with minor changes (d31df99)

1.8.4 (2025-01-19)

Bug Fixes

  • even custom will now have onExapndContent callback and only will happen on open (b1a4a68)

1.8.3 (2025-01-19)

Bug Fixes

  • changed flex to grid for try and get started button (40b0a08)

1.8.2 (2025-01-19)

Bug Fixes

  • documentation changes for onExpandContent (e6cde85)

1.8.1 (2025-01-19)

Bug Fixes

  • added onExpandToast callback use in documentaion (58e5eb5)

1.8.0 (2025-01-19)

Features

  • onExpandToast will be triggered once the toast is expanded (91ba1f5)

1.7.9 (2025-01-18)

Bug Fixes

  • envelope button fills the width in home page toast examples (2b1cf40)

1.7.8 (2025-01-17)

Bug Fixes

  • Card added on above for envelope video in doc (89e7392)

1.7.7 (2025-01-17)

Bug Fixes

  • if there is active quick link selected the text will be bold (20ea3fe)
  • if there is active quick link selected the text will be bold (f9976a8)

1.7.6 (2025-01-16)

Bug Fixes

  • updated latest eft version and added envelope to feature-list (751e0cc)

1.7.5 (2025-01-16)

Bug Fixes

  • maxwidth changes for both desktop and mobile view (b9aa7f2)

1.7.4 (2025-01-16)

Bug Fixes

  • remove duration from toast.envelope (f0d8a0e)

1.7.3 (2025-01-15)

Bug Fixes

  • footer added instead of card (e2d4916)

1.7.2 (2025-01-15)

Bug Fixes

  • Added new page for What's new (06147c1)

1.7.1 (2025-01-15)

Bug Fixes

  • website changes added enevlope documentation (ca69207)

1.7.0 (2025-01-14)

Features

  • enevelop type added in toast component (29bb079)

1.6.7 (2025-01-14)

Bug Fixes

  • added fox quote to desktop size below logo (069085d)
  • website changes made all pages responsive (93aced0)

1.6.6 (2025-01-13)

Bug Fixes

  • website changes quick reference added to installation steps (cef975c)

1.6.5 (2025-01-12)

Bug Fixes

  • website removed unwanted max width from components (b9cb73b)

1.6.4 (2025-01-12)

Bug Fixes

  • corrected sidebar flex and layout changes for quick reference data done (59f8dad)

1.6.3 (2025-01-11)

Bug Fixes

  • structured the api doc layout (8b7c68f)

1.6.2 (2025-01-11)

Bug Fixes

  • added zustand and created right-sidebar for toast-management tab (8061544)

1.6.1 (2025-01-10)

Bug Fixes

  • website changes onDimiss added to doc (56c6f24)
  • website changes onDimiss added to doc (51542c9)

1.6.0 (2025-01-10)

Features

  • onDimiss returns new message parameter on callback (449ff2b)

1.5.21 (2025-01-09)

Bug Fixes

  • website changes applied atomic design to the application (e6fdec7)

1.5.20 (2025-01-09)

Bug Fixes

1.5.19 (2025-01-09)

Bug Fixes

  • webite changes updated package version (8d8579a)

1.5.18 (2025-01-08)

Bug Fixes

  • website changes improved text for doc table header (1b15f3d)

1.5.17 (2025-01-08)

Bug Fixes

  • website changes aligned feature-list to center (0bf1615)

1.5.16 (2025-01-08)

Bug Fixes

  • websitchanges added close button in feature list (6f56bd7)

1.5.15 (2025-01-07)

Bug Fixes

  • website changes doc-sidebar version changed (b3c705f)

1.5.14 (2025-01-07)

Bug Fixes

  • website changed installed new rft version (3cd0fd4)

1.5.13 (2025-01-07)

Bug Fixes

  • website changes added toast api usage mp4 preview to doc (4fe7919)

1.5.12 (2025-01-07)

Bug Fixes

  • changed video with proper cursor and display (f867969)

1.5.11 (2025-01-06)

Bug Fixes

  • resized video for installation step and added black white thumbnail (ed4424a)

1.5.10 (2025-01-06)

Bug Fixes

  • added installation step video to doc (ca6aa72)
  • linter issue fixed (f3068eb)

1.5.9 (2025-01-05)

Bug Fixes

  • website changes added isPausedOnHover on doc (c4f8564)

1.5.8 (2025-01-05)

Bug Fixes

  • added isPausedOnHover in toast-container as props (1cdea5d)

1.5.7 (2025-01-04)

Bug Fixes

  • website changes lucid react icon addded to feature list (7a226d8)

1.5.6 (2025-01-04)

Bug Fixes

  • website changes removed commented code form home page (1c2303e)

1.5.5 (2025-01-03)

Bug Fixes

  • example logo of fox changed (7c91501)

1.5.4 (2025-01-03)

Bug Fixes

  • corrected spellings feature list (578df3a)

1.5.3 (2025-01-02)

Bug Fixes

  • website changes rft version updated (c617ea4)

1.5.2 (2025-01-02)

Bug Fixes

  • added warning toast in documentation (c632202)

1.5.1 (2025-01-01)

Bug Fixes

  • adding warning example with latest rft version (858f66d)

1.5.0 (2025-01-01)

Features

1.4.31 (2025-01-01)

Bug Fixes

  • readme file updated with website link to preview gif (c1b9de0)

1.4.30 (2024-12-31)

Bug Fixes

  • website changes and readme file (4b08f36)

1.4.29 (2024-12-31)

Bug Fixes

  • readme updatest with logo and new preview gif (fa5dcb1)

1.4.28 (2024-12-31)

Bug Fixes

  • website changes stepper gap according to screen size (c3dbf5f)
  • website RFT package updated with latest version (15e1e42)

1.4.27 (2024-12-31)

Bug Fixes

  • website changes added seperator to sidebar (49de2c3)

1.4.26 (2024-12-31)

Bug Fixes

  • website changes added new hook onscreen view load (9d84f19)

1.4.25 (2024-12-30)

Bug Fixes

  • website change span to button for 'Try it yourself' button (a3be654)

1.4.24 (2024-12-30)

Bug Fixes

  • website changes feature list logo change (79ed4cb)

1.4.23 (2024-12-29)

Bug Fixes

  • website changes img change to Image (1e99041)

1.4.22 (2024-12-29)

Bug Fixes

  • website changes commented unwanted code (142a85d)

1.4.21 (2024-12-29)

Bug Fixes

  • added new fox_cook image above title (df79859)

1.4.20 (2024-12-28)

Bug Fixes

  • website sidebar logo changed and adding new images for public website (31a738c)

1.4.19 (2024-12-28)

Bug Fixes

1.4.18 (2024-12-28)

Bug Fixes

  • website missing fox4.ico (f163d9e)

1.4.17 (2024-12-28)

Bug Fixes

  • website added icon header (ad8fa9f)

1.4.16 (2024-12-27)

Bug Fixes

  • website main page title size increased (ac83509)

1.4.15 (2024-12-27)

Bug Fixes

1.4.14 (2024-12-27)

Bug Fixes

  • wesbiste home page logo changed with title font (c34d9ec)

1.4.13 (2024-12-27)

Bug Fixes

  • wesbiste changes -removed uncessary font family from global css (16d06bb)

1.4.12 (2024-12-26)

Bug Fixes

  • header slider padding-x reduced (29b7757)

1.4.11 (2024-12-26)

Bug Fixes

  • added icons to readme file (95930c3)

1.4.10 (2024-12-26)

Bug Fixes

  • website codeSyntax tab animation improved and structure improved too (1579e18)

1.4.9 (2024-12-25)

Bug Fixes

  • website tab colour pattern fixed (b1cf1ff)

1.4.8 (2024-12-25)

Bug Fixes

  • changed tab size for syntax highlighter (4646e48)

1.4.7 (2024-12-24)

Bug Fixes

  • reduced min width of terminal tabs (587d723)

1.4.6 (2024-12-24)

Bug Fixes

1.4.5 (2024-12-23)

Bug Fixes

  • added direction props to ToastContainer (a87aab9)

1.4.4 (2024-12-23)

Bug Fixes

  • rearranged functions and added pause and resume doc in website (ec197a8)

1.4.3 (2024-12-22)

Bug Fixes

  • added toast.resume(id) for resuming paused time on toast (cac2867)

1.4.2 (2024-12-22)

Bug Fixes

  • added toast.pause(id) for pausing time on toast (bac20ee)

1.4.1 (2024-12-21)

Bug Fixes

  • Added direction support for rtl (b286055)

1.4.0 (2024-12-20)

Features

  • added reaminingTime(id) (d59f126)

1.3.2 (2024-12-20)

Bug Fixes

  • added minzip badge to readme (623e2c3)

1.3.1 (2024-12-17)

Bug Fixes

  • closeBtnStyle added for passing customize close button (f342227)

1.3.0 (2024-12-16)

Features

  • close button is enhanced (f1a50a7)

1.2.4 (2024-12-14)

Bug Fixes

  • custom will accept toast.custom() and toast() both (4cdfffe)

1.2.3 (2024-12-12)

Bug Fixes

  • web, doc link with few web UI syntax fixes (67ee5af)

1.2.2 (2024-12-12)

Bug Fixes

  • removeAll function, isPausedOnHover, global duration (804a60d)

1.2.1 (2024-12-10)

Bug Fixes

  • Readme will have website and documentation clicks (185ae45)

1.2.0 (2024-12-10)

Features

  • new configurable position in ToastContainer (c6892f4)

1.1.7 (2024-12-09)

Bug Fixes

  • Republishing Readme for missing readme issue (3377829)

1.1.6 (2024-12-08)

Bug Fixes

  • readme click button size changed (6bfbca2)

1.1.5 (2024-12-08)

Bug Fixes

  • zindex for container , readme click btn changes and added few pages for website (501bd71)

1.1.4 (2024-12-08)

Bug Fixes

  • added demp link in readme and some UI alignments and improvements (d2332f3)

1.1.3 (2024-12-07)

Bug Fixes

  • using goober keyframe for animation and removed isVisible state from toast (040dc3e)

1.1.2 (2024-12-06)

Bug Fixes

  • Added LICENSE and few fixes on readme (543eb00)

1.1.1 (2024-12-06)

Bug Fixes

  • build script added in workflow (46ff10c)

1.1.0 (2024-12-06)

Features

  • created stores and new features for toast (d7c4c80)
  • created toast-store simplified toast and its usage for developers (c4555b1)

1.0.1 (2024-12-02)

Bug Fixes

1.0.0 (2024-12-02)

Bug Fixes

  • release flow updates (0e152c8)
  • release flow updates removed github from yml (d2ef50e)
  • toast will accept empty options as 2nd parameter (ce8b871)

1.0.0 (2024-12-02)

Bug Fixes

  • toast will accept empty options as 2nd parameter (ce8b871)