Ai input

AI input with a single-line field, a submit button, and an optional skip text button.

Contents

Set skipLabel to show a text button in place of the submit button while the field is empty. It hands the place back on the first keystroke, so type and then clear the field to see the swap both ways. Pair it with onSkip to handle the click.

Skipped: false

Paired with buttonText, the swap goes from a Skip label to a labelled pill.

Set showSkipBesideSubmit to keep both buttons on the row instead, so a question can be answered by picking an option alone.

Inputs in Skip label
minCharacters ?: number = 6

Character threshold at which the submit button expands (requires `buttonText`).

skipLabel ?: string

When set, shows a Skip text button in place of the submit button while the field is empty.

Also set in this example
control : FormControl<string>
buttonText ?: string = ''

When set, the submit button expands into a labelled pill once `minCharacters` is reached.

placeholder ?: string = ''
showSkipBesideSubmit ?: boolean = false

Renders Skip beside the submit button instead of replacing it.

Outputs
onBlur ?: any = new EventEmitter<void>()
onFocus ?: any = new EventEmitter<void>()
onInputHandled ?: any = new EventEmitter<void>()
onSkip ?: any = new EventEmitter<void>()
onSubmit ?: any = new EventEmitter<void>()