百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
R

react-notifications-component

> 前端框架
开源

令人愉悦且高度可定制的 React 组件,可通知您的用户

1.3K stars0 点赞2 次浏览
访问官网GitHub

工具介绍

令人愉悦且高度可定制的 React 组件,可通知您的用户

React-notifications-component 一个美观、易用且高度可配置的组件,可帮助您立即向用户发送通知。无需复杂设置,只需美观的通知即可!

SASS

SASS 文件位于 React-notifications-component/dist/scss 在应用程序的顶部渲染 React-notifications-component,以免与其他绝对定位的 DOM 元素发生冲突。

javascript
const App = () => {
  return (
    

  )
};

根据需要导入 Store - 将用于访问 addNotification 和 removeNotification API 方法

javascript
import { Store } from 'react-notifications-component';

然后调用 addNotification 并观察魔术的发生

javascript
Store.addNotification({
  title: "Wonderful!",
  message: "teodosii@react-notifications-component",
  type: "success",
  insert: "top",
  container: "top-right",
  animationIn: ["animate__animated", "animate__fadeIn"],
  animationOut: ["animate__animated", "animate__fadeOut"],
  dismiss: {
    duration: 5000,
    onScreen: true
  }
});

Voila!

注意: 在此示例中,我们依赖 animate.css,因为 animate__fadeIn 和 animate__fadeOut 都是 animate.css 的一部分。我们建议使用它,因为它是一个优秀的动画库,但你并非必须使用它。如果你更喜欢,也可以使用自定义的动画,只要它们符合 vali

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

TypeScriptnotificationsnotifications-componentreactreact-component

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类前端框架
定价开源

> 相关工具

R
React
用于构建用户界面的 JavaScript 库
V
Vue.js
渐进式 JavaScript 框架
N
Next.js
基于 React 的全栈 Web 框架