@contentstack/react-toastify

中文文档
6.1.5发布于 2025/04/25MITTypeScriptESM + CJS近 30 天下载 7189

React notification made easy

原始使用文档
文档目录10 节
  1. Installation
  2. The gist
  3. Demo
  4. Documentation
  5. Contribute
  6. Contributors
  7. Code Contributors
  8. Financial Contributors
  9. Release Notes
  10. License

React-Toastify

Financial Contributors on Open Collective React-toastify CI npm npm NPM Coveralls github React toastify

🎉 React-Toastify allows you to add notifications to your app with ease. No more nonsense!

Installation

$ npm install --save react-toastify
$ yarn add react-toastify

The gist

  import React from 'react';

  import { ToastContainer, toast } from 'react-toastify';
  import 'react-toastify/dist/ReactToastify.css';
  
  function App(){
    const notify = () => toast("Wow so easy !");

    return (
      <div>
        <button onClick={notify}>Notify !</button>
        <ToastContainer />
      </div>
    );
  }

Demo

A demo is worth a thousand words

Documentation

Check the documentation to get you started !

Contribute

Show your ❤️ and support by giving a ⭐. Any suggestions are welcome! Take a look at the contributing guide.

You can also find me on reactiflux. My pseudo is Fadi.

Contributors

Code Contributors

This project exists thanks to all the people who contribute. [Contribute].

Financial Contributors

Become a financial contributor and help us sustain our community. [Contribute]

Individuals

Organizations

Support this project with your organization. Your logo will show up here with a link to your website. [Contribute]

Release Notes

You can find the release note for the latest release here

You can browse them all here

License

Licensed under MIT

版本与发布记录

@contentstack/react-toastify 共发布 2 个版本,首次发布于 2025/04/23;过去 12 个月发布了 0 个版本。

版本发布日期距今
6.1.5latest2025/04/251.5 年前
6.1.22025/04/231.5 年前

关于 @contentstack/react-toastify 的常见问题

@contentstack/react-toastify 是什么?

React notification made easy

如何安装 @contentstack/react-toastify?

在项目目录运行 npm install @contentstack/react-toastify,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:react(>=16)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@contentstack/react-toastify 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@contentstack/react-toastify 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@contentstack/react-toastify 可以商用吗?

@contentstack/react-toastify 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@contentstack/react-toastify 的下载量有多少?

根据 npm 官方下载统计,@contentstack/react-toastify 在 2026/10/11 – 2026/11/09 这 30 天内被下载 7,189 次,日均约 240 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@contentstack/react-toastify 还在维护吗?

最新版本 6.1.5 发布于 2025/04/25(1.5 年前);至今共发布 2 个版本,其中过去 12 个月发布了 0 个;首次发布于 2025/04/23。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。