跳转到内容
搜索文档

RtkNotification

最后更新 查看 MarkdownAgent 设置

带有滑入/滑出动画、头像、消息文本和关闭按钮的单个通知气泡(toast)。

属性

属性 类型 必填 默认值 描述
notification Notification - 包含 id、message、image、duration 和 button 的通知对象
onRtkNotificationDismiss any - 关闭通知时的回调
iconPack IconPack defaultIconPack 自定义图标包
size 'lg' | 'md' | 'sm' | 'xl' 'sm' 尺寸变体
t RtkI18n - i18n 翻译函数

使用示例

基本用法

import { RtkNotification } from "@cloudflare/realtimekit-react-native-ui";

function MyComponent() {
	return <RtkNotification notification={notification} />;
}

带有属性

import { RtkNotification } from "@cloudflare/realtimekit-react-native-ui";

function MyComponent() {
	return (
		<RtkNotification
			notification={notification}
			onRtkNotificationDismiss={(id) => handleDismiss(id)}
			size="md"
		/>
	);
}

这篇文档对您有帮助吗?