CommentComposer
Data Display

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

TSX
import { CommentComposer } from "@solarius/onset";

Props

CommentComposerProps props
PropTypeDefaultDescription
valuestring—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.
placeholderstring"Leave a comment…"Textarea placeholder.
initialsstring—Initials for the leading avatar. Omit to drop.
autoFocusboolean—Auto-focus the textarea on mount.
compactboolean—Reduces padding and hides the avatar for inline replies.
submitLabelstring"Comment"Submit button label.
disabledboolean—Disables the textarea and button.

Example

CommentComposer