NotificationCenter 通知中心
业务组件
通知中心 — 面向 ERP/企业场景的业务组件。
何时使用
站内消息/通知聚合列表,展示未读/已读状态。
代码示例
基础用法
tsx
import { NotificationCenter } from "@/components/business/notification-center"
export function Basic() {
return <NotificationCenter />
}API / Props
NotificationCenter
| Prop | Type | Default | 说明 |
|---|---|---|---|
className | string | — | 自定义样式类名 |
notifications | NotificationItem[] | — | |
onMarkRead | () => void | — | |
onMarkAllRead | () => void | — | |
onClear | () => void | — | |
onItemClick | () => void | — | |
align | "start" | "center" | "end" | end | 对齐方式 |
emptyText | string | 暂无通知 | |
| ...rest | React.HTMLAttributes | — | 透传原生 DOM 属性 |
注意事项
- Client Component: 使用
"use client",依赖 React hooks/状态,需在客户端渲染。
📘 完整交互式示例与控件属性请查看 Storybook 文档。