CommentComposer
Compose plain text comments with submit and cancel handlers.
CommentComposer renders a plain text area with submit and optional cancel actions. The application stores the draft through value and onChange and sends it through onSubmit.
Import
import { CommentComposer } from "@solarius/onset";Props
| Prop | Type | Default | Description |
|---|---|---|---|
value | string | — | Controlled textarea value. |
onChange | (value: string) => void | — | Change handler. |
onSubmit | () => void | — | Called on ⌘/Ctrl+Enter. |
onCancel | () => void | — | Called on Escape. Providing the handler also displays a Cancel button. |
placeholder | string | "Leave a comment…" | Textarea placeholder. |
initials | string | — | Initials for the leading avatar. Omit to drop. |
autoFocus | boolean | — | Auto-focus the textarea on mount. |
compact | boolean | — | Reduces padding and hides the avatar for inline replies. |
submitLabel | string | "Comment" | Submit button label. |
disabled | boolean | — | Disables the textarea and button. |