莉维亚提到过你
2m
您可以在我们发布仪表盘之前查看新的空状态吗?
CLI 将组件源(及其内部依赖项)复制到您的项目中并安装任何所需的 npm 包。
npx boardui@latest add notification-center使用共享 UI 包或自定义导入别名? 配置您的安装路径 在运行 CLI 之前。复制粘贴示例使用默认导入。
默认情况下,中心拥有其活动过滤器。使用 defaultTab 对于初始视图,或组合 tab 和 onTabChange 当周围产品需要控制状态时。
<NotificationCenter notifications={notifications} defaultTab="mentions"/>
{/* Controlled filtering */}<NotificationCenter notifications={notifications} tab={activeTab} onTabChange={setActiveTab}/>每个项目都声明其过滤器类别和时间线组。添加头像或者语义状态图标,设置 unread,并附加小动作。操作按下标记该项目读取并报告两个 ID onAction.
const notification = { id: "deploy-failed", category: "system", // mentions | system | activity group: "Earlier this week", title: "Preview deployment failed", description: "The build stopped while validating routes.", timestamp: "Sat", unread: true, status: "error", // neutral | information | success | error actions: [ { id: "retry", label: "Retry", variant: "primary" }, { id: "logs", label: "View logs", variant: "secondary" }, ],};