Prompt Input

The field the person types into to message the agent, with attachments and a send button.

Usage

Prompt Input

import { Component, ViewEncapsulation, computed, signal } from '@angular/core';import { FormField, FormRoot, form } from '@angular/forms/signals';import {  ScAttachment,  ScAttachmentAction,  ScAttachmentActions,  ScAttachmentContent,  ScAttachmentMedia,  ScAttachmentTitle,  ScInputGroup,

An Input Group around a textarea bound with Signal Forms, an attach button, the Model Selector menus and a send button. Attached files show as Attachment chips above the text.

Anatomy

import {  ScInputGroup, ScInputGroupAddon, ScInputGroupButton, ScTextarea,} from '@semantic-components/ui';import { FormField, FormRoot, form } from '@angular/forms/signals';
<form [formRoot]="composer">  <div scInputGroup>    <textarea scTextarea aria-label="Message" [formField]="composer.text"      (keydown.enter)="sendOnEnter($event)"></textarea>    <div scInputGroupAddon side="bottom">      <button scInputGroupButton type="button" size="icon-sm" variant="outline">        <svg siPlusIcon></svg>        <span class="sr-only">Attach files</span>      </button>      <button scInputGroupButton type="submit" size="icon-sm" class="ms-auto">        <svg siArrowUpIcon></svg>        <span class="sr-only">Send</span>      </button>    </div>  </div></form>

Attachments

The attach button opens a hidden file input. Each file shows as an Attachment in an addon on top, with a button to remove it, named by the file ("Remove report.pdf").

Model and effort

The two Model Selector menus go in the bottom addon, between the attach and send buttons: the first menu's ms-auto pushes both next to Send.

Keyboard

Enter sends the message; Shift + Enter adds a new line. Send is disabled while the field is empty.

Examples

RTL

التقرير.pdf
import { Dir } from '@angular/cdk/bidi';import { Component, LOCALE_ID, ViewEncapsulation } from '@angular/core';import {  ScAttachment,  ScAttachmentAction,  ScAttachmentActions,  ScAttachmentContent,  ScAttachmentMedia,  ScAttachmentTitle,  ScInputGroup,

API reference

See the Input Group, the Attachment and the Menu.