SearchCtrlK

  • ↑↓navigate
  • ↵open
  • escclose

Can’t find it? Contact us

composerSend

Wires a composer's send control.

tsx
import { composerSend } from "@sdxc/ui/chat";

Usage

Put on an element inside a composer's form, around its send and stop buttons. It finds the form's Composer.Input, and a click on a [data-slot="composer-stop"] inside it stops the replay.

Signature

typescript
composerSend(options: ComposerSendOptions): MixinDescriptor<HTMLElement>

Parameters

ParameterTypeRequiredDescription
optionsComposerSendOptionsYes

Examples

tsx
<span mix={[composerSend({ stream: "reply-7", onStreamingChange: (on) => … })]}>…</span>

The events, constants and types its module publishes, each imported from @sdxc/ui/chat too.

Constant

COMPOSER_STOP_SLOT

The slot of the button that stops a streaming reply, inside the mixin's host.

typescript
const COMPOSER_STOP_SLOT = "composer-stop"
Interface

ComposerSendOptions

Options for composerSend.

MemberTypeRequiredDescription
streamstringNoThe id of a reply the page just answered with, marked data-stream-pending; it replays as a stream, or shows at once under reduced motion.
streamKeystringNoChanges with every new reply, so a reply that reuses the previous one's id replays too.
onStreamingChange(streaming: boolean) => voidYesTold when a replay starts and ends, so the host can swap Send for Stop.
@sdxc/ui

Can’t find it? Contact us