Overview
TheTextareaRenderable component provides a powerful multi-line text editing experience with support for text wrapping, selection, undo/redo, and extensive keyboard shortcuts. It extends EditBufferRenderable with rich text editing capabilities.
Basic Usage
Props
string
Initial text content (can include newlines)
StyledText | string | null
default:"null"
Placeholder shown when textarea is empty. Can be plain text or styled text.
ColorInput
default:"'transparent'"
Background color when unfocused
ColorInput
default:"'#FFFFFF'"
Text color when unfocused
ColorInput
default:"backgroundColor"
Background color when focused (falls back to backgroundColor)
ColorInput
default:"textColor"
Text color when focused (falls back to textColor)
ColorInput
default:"'#666666'"
Color of placeholder text
KeyBinding[]
Custom key bindings to override or extend default shortcuts
KeyAliasMap
Custom key aliases for remapping keyboard shortcuts
(event: SubmitEvent) => void
Callback fired when submit action is triggered (Meta+Enter)
Inherited Props from EditBufferRenderable
number
Height in terminal rows
number
Minimum height for flex layouts
number
Maximum height for flex layouts
'none' | 'word' | 'char'
default:"'word'"
Text wrapping behavior
Events
TextareaRenderable doesn’t emit its own events by default, but you can use theonSubmit callback for form submissions.