Overview
Collect single-line user input.Import
Usage
Live Preview
Run Locally
npm run tsx:core-gallery
Props
- message: string — Prompt message.
- onSubmit: (value: string) => void — Required submit handler.
- placeholder?: string — Placeholder text.
- defaultValue?: string — Initial input value.
- width?: string | number — Default 70%.
- height?: number — Default 7.
- onCancel?: () => void — Esc handler.
Methods
- setMessage(text), setValue(value), getValue(), setPlaceholder(text), setDefaultValue(value).
- focus(), blur(), clear(), submit(), cancel().
- setDimensions(w, h), show(), hide().
Keyboard
- Enter: submit value.
- Esc: cancel (if onCancel provided) and close.
Installation
Import
Quick Start
Production Examples
Best Practices
- Mantieni i prompt brevi; per form multi-campo usa Modal + TextInput.
