渲染聊天编辑器的组件
| 属性 | 类型 | 是否必填 | 默认值 | 描述 |
|---|---|---|---|---|
canSendFiles |
boolean |
✅ | - | 用户是否可以发送文件消息 |
canSendTextMessage |
boolean |
✅ | - | 用户是否可以发送文本消息 |
iconPack |
IconPack1 |
❌ | defaultIconPack |
图标包 |
inputTextPlaceholder |
string |
✅ | - | 文本输入框占位字符 |
isEditing |
boolean |
✅ | - | 将编辑器设置为编辑模式 |
maxLength |
number |
✅ | - | 文本输入的最大长度 |
message |
string |
✅ | - | 要预填的消息 |
quotedMessage |
string |
✅ | - | 要显示的引用消息 |
rateLimits |
{ period: number; maxInvocations: number; } |
✅ | - | 速率限制 |
storageKey |
string |
✅ | - | 在 localStorage 中存储消息的键名 |
t |
RtkI18n1 |
❌ | useLanguage() |
语言 |
import { RtkChatComposerView } from '@cloudflare/realtimekit-react-ui';
function MyComponent() {
return <RtkChatComposerView />;
}import { RtkChatComposerView } from '@cloudflare/realtimekit-react-ui';
function MyComponent() {
return (
<RtkChatComposerView
canSendFiles={true}
canSendTextMessage={true}
inputTextPlaceholder="example"
/>
);
}