RtkTextComposerView
{/* AUTO-GENERATED FILE. DO NOT EDIT MANUALLY. Any manual changes will be overwritten the next time the docs are generated.
Source: https://github.com/cloudflare/realtimekit-ui/blob/main/packages/core/src/components/rtk-text-composer-view/rtk-text-composer-view.tsx Generator: https://github.com/cloudflare/realtimekit-ui/blob/main/scripts/generate-stencil-docs.js
To update this page, edit the component source in the realtimekit-ui repository and submit a pull request against the staging branch; the changes will automatically sync here upon the next release. */}
A component which renders a text composer
Properties
| Property | Type | Required | Default | Description |
|---|---|---|---|---|
disabled |
boolean |
✅ | - | Disable the text input (default = false) |
iconPack |
IconPack1 |
❌ | defaultIconPack |
Icon pack |
keyDownHandler |
(e: KeyboardEvent) => void |
✅ | - | Keydown event handler function |
maxLength |
number |
✅ | - | Max length for text input |
placeholder |
string |
✅ | - | Placeholder text |
rateLimitBreached |
boolean |
✅ | - | Boolean to indicate if rate limit is breached |
setText |
(text: string, focus?: boolean) => Promise<void> |
❌ | - | Sets value of the text input |
t |
RtkI18n1 |
❌ | useLanguage() |
Language |
value |
string |
✅ | - | Default value for text input |
Usage Examples
Basic Usage
import { RtkTextComposerView } from '@cloudflare/realtimekit-react-ui';
function MyComponent() {
return <RtkTextComposerView />;
}
With Properties
import { RtkTextComposerView } from '@cloudflare/realtimekit-react-ui';
function MyComponent() {
return (
<RtkTextComposerView
disabled={true}
keyDownHandler={handleEvent}
maxLength={42}
/>
);
}
这篇文档对你有帮助吗?
谢谢你的反馈!