Notification 通知框

用于系统通知。 通常用于推送消息。

获取组件

import { Notification } from 'rsuite';

演示

默认

通知类型

可关闭的

与 toaster 组合

Props

<Notification>

Property Type (Default) Description
children * ReactNode 通知的内容
closable boolean 是否显示关闭按钮
duration number (4500) ⚠️[已弃用]请使用 toaster.push(<Notification />, { duration: 2000 }) 代替。
header * string 通知的标题
onClose () => void 通知被移除后的回调函数
placement Placement('topCenter') 通知出现的位置
type 'info' | 'success' | 'warning' | 'error' ('info') 通知类型

ts:Placement

type Placement = 'topStart' | 'topCenter' | 'topEnd' | 'bottomStart' | 'bottomCenter' | 'bottomEnd';
Vercel banner