ChatInputComponent

Provides an auto-resizing message composer that submits to an agent and can stop its current response.

import { ChatInputComponent } from '@threadplane/chat';

Declaration

export declare class ChatInputComponent  {
  constructor();
  readonly agent: import("@angular/core").InputSignal<Agent<unknown>>;
  readonly canStop: import("@angular/core").Signal<boolean>;
  readonly canSubmit: import("@angular/core").Signal<boolean>;
  readonly focused: import("@angular/core").WritableSignal<boolean>;
  focusTextarea(): void;
  readonly isLoading: import("@angular/core").Signal<boolean>;
  readonly messageText: import("@angular/core").WritableSignal<string>;
  onKeydown(event: KeyboardEvent): void;
  onStop(): void;
  onSubmit(): void;
  readonly placeholder: import("@angular/core").InputSignal<string>;
  readonly showStopButton: import("@angular/core").InputSignal<boolean>;
  readonly stopped: import("@angular/core").OutputEmitterRef<void>;
  readonly submitOnEnter: import("@angular/core").InputSignal<boolean>;
  readonly submitted: import("@angular/core").OutputEmitterRef<string>;
}

Angular template API

Selector: chat-input

Inputs

agent · required
Agent<unknown>
placeholder
string
showStopButton
boolean
submitOnEnter
boolean

Outputs

stopped
void
submitted
string

Members

Constructor · overload 1

Auto-resize the textarea to fit its content as the user types or pastes multi-line text. Caps at min(40vh, 320px); beyond that the textarea scrolls. Without this, multi-line input is hidden behind the rows="1" fixed height (caught by live browser smoke).

constructor();

agent

readonly agent: import("@angular/core").InputSignal<Agent<unknown>>;

canStop

The stop button only appears when the consumer opted in AND we're loading.

readonly canStop: import("@angular/core").Signal<boolean>;

canSubmit

Submit is allowed only when not loading and there's non-whitespace text.

readonly canSubmit: import("@angular/core").Signal<boolean>;

focused

readonly focused: import("@angular/core").WritableSignal<boolean>;

focusTextarea · overload 1

focusTextarea(): void;

Returns

void

isLoading

readonly isLoading: import("@angular/core").Signal<boolean>;

messageText

readonly messageText: import("@angular/core").WritableSignal<string>;

onKeydown · overload 1

onKeydown(event: KeyboardEvent): void;

Parameters

event · required
KeyboardEvent

Returns

void

onStop · overload 1

Abort the current streaming response (if the adapter supports it).

onStop(): void;

Returns

void

onSubmit · overload 1

onSubmit(): void;

Returns

void

placeholder

readonly placeholder: import("@angular/core").InputSignal<string>;

showStopButton

When true (default), shows a stop button while the agent is streaming.

readonly showStopButton: import("@angular/core").InputSignal<boolean>;

stopped

readonly stopped: import("@angular/core").OutputEmitterRef<void>;

submitOnEnter

readonly submitOnEnter: import("@angular/core").InputSignal<boolean>;

submitted

readonly submitted: import("@angular/core").OutputEmitterRef<string>;