Skip to content

Agent Input ​

The agent chat dock: a frosted container pairing an auto-clamped input region with a toolbar row of action atoms and a circular send button; the send button becomes a stop affordance while generating.

Examples ​

Chat dock ​

moonbit
@sumi.agent_input(
  value=current,
  placeholder="Describe your idea, or type / to use a skill",
  on_input=set_prompt.map(v => _ => v),
  on_send=set_prompt(_ => ""),
  send_disabled=current.is_empty(),
  actions=[
    @sumi.icon_button(@sumi.icon_plus_fill(size=14), aria_label="Add attachment"),
    @sumi.agent_tool_button(@sumi.icon_skill(), label="Use Skill"),
    @sumi.icon_button(@sumi.icon_at(), aria_label="Mention a reference"),
  ],
)

API ​

agent_input ​

NameTypeDefaultDescription
valueString""Current text (controlled)
placeholderString""Placeholder text
rowsInt3Visible row count of the textarea
on_inputEmit[String]—Called on every input
on_sendCmd—Send command
on_stopCmd—Stop command while generating
send_disabledBoolfalseDisables the send button
send_loadingBoolfalseSwaps the glyph for a spinner
generatingBoolfalseSwaps send for the stop square
disabledBoolfalseBlocks interaction and dims the control
autofocusBool—Focus the control on mount
actionsArray[Html][]Left toolbar atoms (icon buttons, tool pills)
childrenArray[Html]—Rich inline content replacing the textarea
aria_labelString—
idString—Element id
classString—Extra class names
attrsAttrs—Extra HTML attributes
styleArray[String][]Extra inline styles

agent_tool_button ​

The icon-leading toolbar pill.

NameTypeDefaultDescription
iconHtml—
label *String—12/20 label text
disabledBoolfalseBlocks interaction and dims the control
on_clickCmd—Click command
idString—Element id
classString—Extra class names
titleString—Native tooltip title
aria_labelString—
attrsAttrs—Extra HTML attributes
styleArray[String][]Extra inline styles

* required (labelled) parameter — everything else is optional.