← Cloudflare Realtime / realtime / realtimekit / ui-kit / api-reference / core
rtk-chat-composer-view
Komponenta, která vykresluje editor zpráv v chatu
Vlastnosti
| Vlastnost | Typ | Povinné | Výchozí | Popis |
|---|---|---|---|---|
canSendFiles |
boolean |
✅ | - | Zda uživatel může odesílat zprávy se soubory |
canSendTextMessage |
boolean |
✅ | - | Zda uživatel může odesílat textové zprávy |
iconPack |
IconPack1 |
❌ | defaultIconPack |
Sada ikon |
inputTextPlaceholder |
string |
✅ | - | Zástupný text pro textové vstupní pole |
isEditing |
boolean |
✅ | - | Nastaví composer do režimu úprav |
maxLength |
number |
✅ | - | Maximální délka textového vstupu |
message |
string |
✅ | - | Zpráva, která se má předvyplnit |
quotedMessage |
string |
✅ | - | Citovaná zpráva, která se má zobrazit |
rateLimits |
{ period: number; maxInvocations: number; } |
✅ | - | Limity počtu požadavků |
storageKey |
string |
✅ | - | Klíč pro ukládání zprávy do localStorage |
t |
RtkI18n1 |
❌ | useLanguage() |
Jazyk |
Příklady použití
Základní použití
<rtk-chat-composer-view></rtk-chat-composer-view>S vlastnostmi
<rtk-chat-composer-view
inputTextPlaceholder="example">
</rtk-chat-composer-view><script>
const el = document.querySelector("rtk-chat-composer-view");
el.canSendFiles= true;
el.canSendTextMessage= true;
</script>