ChatInputProps

Unpublished development API. This package is under development and is not available as a published release.

Configures a controlled or local message draft, submission and stop callbacks, and composer labels.

import type { ChatInputProps } from '@threadplane/react/chat';

Declaration

export interface ChatInputProps  {
  readonly busy?: boolean;
  readonly className?: string;
  readonly defaultValue?: string;
  readonly disabled?: boolean;
  readonly hint?: ReactNode;
  readonly id?: string;
  readonly label?: string;
  readonly onStop?: () => void;
  readonly onSubmit: (text: string) => boolean | void;
  readonly onValueChange?: (value: string) => void;
  readonly placeholder?: string;
  readonly submitOnEnter?: boolean;
  readonly value?: string;
}

Members

busy

readonly busy?: boolean;

className

readonly className?: string;

defaultValue

readonly defaultValue?: string;

disabled

readonly disabled?: boolean;

hint

readonly hint?: ReactNode;

id

readonly id?: string;

label

readonly label?: string;

onStop

readonly onStop?: () => void;

onSubmit

Receives the draft as typed (trim only gates emptiness). Return false to keep it.

readonly onSubmit: (text: string) => boolean | void;

onValueChange

readonly onValueChange?: (value: string) => void;

placeholder

readonly placeholder?: string;

submitOnEnter

Enter sends and Shift+Enter adds a line. Ctrl/⌘+Enter always sends.

readonly submitOnEnter?: boolean;

value

readonly value?: string;