Skip to content

非公式 / UnofficialCloudflare, Inc. 非提携。アカウント情報は入力しないでください。Not affiliated with Cloudflare, Inc. Do not enter Cloudflare credentials here.Official docsこのサイトについてプライバシー

RtkMessageView

最終更新 Markdown で表示Agent セットアップ

プロパティ

プロパティ 型 必須 デフォルト 説明
actions MessageAction[] ✅ - メニューに表示するアクションの一覧
authorName string ✅ - 投稿者の表示ラベル
avatarUrl string ✅ - アバター画像の URL
hideAuthorName boolean ✅ - 投稿者の表示ラベルを隠します
hideAvatar boolean ✅ - アバターを隠します
hideMetadata boolean ✅ - メタデータ(時刻)を隠します
iconPack IconPack1 ❌ defaultIconPack アイコンパック
isEdited boolean ✅ - メッセージが編集済みかどうか
isSelf boolean ✅ - 現在のユーザーが送信したメッセージかどうか
messageType Message['type'] ✅ - メッセージの種類
pinned boolean ✅ - メッセージがピン留めされているかどうか
time Date ✅ - メッセージの送信時刻
variant 'plain' | 'bubble' ✅ - 見た目
viewType 'incoming' | 'outgoing' ✅ - 描画方向

使用例

基本的な使い方

import { RtkMessageView } from '@cloudflare/realtimekit-react-ui';

function MyComponent() {
  return <RtkMessageView />;
}

プロパティを指定する場合

import { RtkMessageView } from '@cloudflare/realtimekit-react-ui';

function MyComponent() {
  return (
    <RtkMessageView
      actions={[]}
      authorName="example"
      avatarUrl="example"
    />
  );
}

役に立ちましたか?