Chat

The full chat anatomy: pane, thread, messages, composer, submit, suggestions and typing indicator. Attachments sit above the field as small cards you can remove.

Available in
  • Angular: available
  • Vue: available
  • React: available
  • React Native: not available yet

Usage

Ask about this meeting

Answers use the planning meeting transcript
What did Ada and Leo decide about the onboarding checklist?
They agreed to cut the checklist from twelve steps to five and to ship the shorter version behind a feature flag first. Leo owns the rollout.
Planning meetingmeetings.example.com/planning

Import

ts
import {
  SoneChatAttachmentComponent,
  SoneChatComposerComponent,
  SoneChatComposerInputDirective,
  SoneChatComposerSubmitComponent,
  SoneChatComposerToolsDirective,
  SoneChatMessageComponent,
  SoneChatMessageContentDirective,
  SoneChatPaneActionsDirective,
  SoneChatPaneDescriptionDirective,
  SoneChatPaneDirective,
  SoneChatPaneHeaderDirective,
  SoneChatPaneHeadingDirective,
  SoneChatPaneTitleDirective,
  SoneChatThreadComponent,
  SoneSuggestionChipsComponent,
  SoneTypingIndicatorComponent,
} from "@surface-one/angular/chat";

API reference

SoneChatAttachmentComponentComponent

`<sone-chat-attachment>` — a linked or uploaded item in the composer: a grey card with a mark (the projected content: a favicon, a file icon, a `<sone-mark>`), the `title` and its `url` (or a size), and — when `removable` — a small round remove button (“Remove {title}”) that emits `remove`. Put it inside `<sone-chat-composer>`, which lines attachments up above the field.

Selector
sone-chat-attachment
Inputs
NameType Default
title

What it is: a page title, a file name.

string""
url

Where it is (or its size), under the title.

string | nullnull
removable

Shows the remove button.

booleanfalse
Outputs
NameType
remove

The remove button was pressed.

void

SoneChatComposerComponentComponent

Selector
sone-chat-composer
Inputs
NameType Default
layoutChatComposerLayout"inline"
Outputs
NameType
submittedvoid

SoneChatComposerInputDirectiveDirective

Selector
textarea[soneChatComposerInput]
Outputs
NameType
draftInputstring

SoneChatComposerSubmitComponentComponent

Selector
sone-chat-composer-submit
Inputs
NameType Default
pendingbooleanfalse
disabledbooleanfalse

SoneChatComposerToolsDirectiveDirective

Selector
[soneChatComposerTools]

SoneChatMessageComponentComponent

Selector
sone-chat-message
Inputs
NameType Default
fromrequiredChatMessageFrom—
variantBubbleVariant | nullnull

SoneChatMessageContentDirectiveDirective

Selector
[soneChatMessageContent]
Inputs
NameType Default
labelstring | undefinedundefined

SoneChatPaneActionsDirectiveDirective

Selector
[soneChatPaneActions]

SoneChatPaneDescriptionDirectiveDirective

Selector
[soneChatPaneDescription]

SoneChatPaneDirectiveDirective

Selector
[soneChatPane]
Inputs
NameType Default
barebooleanfalse

SoneChatPaneHeaderDirectiveDirective

Selector
[soneChatPaneHeader]

SoneChatPaneHeadingDirectiveDirective

Selector
[soneChatPaneHeading]

SoneChatPaneTitleDirectiveDirective

Selector
[soneChatPaneTitle]

SoneChatThreadComponentComponent

Selector
sone-chat-thread
Inputs
NameType Default
label—$localize`Conversation`

SoneSuggestionChipsComponentComponent

Selector
sone-suggestion-chips
Inputs
NameType Default
suggestionsreadonly string[][]
disabledbooleanfalse
label—$localize`Suggested questions`
Outputs
NameType
pickedstring

SoneTypingIndicatorComponentComponent

Selector
sone-typing-indicator
Inputs
NameType Default
label—$localize`Thinking`