Bus UI Assistant

AIComposer owns the draft input row.

Use it for controlled prompt entry, send actions, and optional interrupt actions without moving composer state out of the host.

Public API

AIComposer(p AIComposerProps) gx.Node

When to use it

Use AIComposer when the assistant surface already owns the draft text and needs a deterministic control row for input and send behavior.

Key props

ID, InputID, Value, Placeholder, Disabled, OnInput, OnSend, OnInterrupt, and Attrs.

Example

Loading AIComposer demo...

Go API

import (
  gx "github.com/busdk/bus-gx/pkg/gx"
  assistantui "github.com/busdk/bus-ui/pkg/assistantui"
)

node := assistantui.AIComposer(assistantui.AIComposerProps{
  ID:    "composer-1",
  Value: "Summarize the diff",
})

html, err := gx.RenderHTML(node)

.gx source

In .gx source, author the visible component state as GX markup. Keep the Go API block above for the package helper or render-boundary call.

package busuiexamples

import gx "github.com/busdk/bus-gx/pkg/gx"

func AIComposerExample() gx.Node {
  return <form class="ai-composer" method="post">
  <label for="draft"><Text value={"Prompt"}></Text></label>
  <textarea id="draft" name="draft" placeholder="Check the diff"></textarea>
  <button type="submit"><Text value={"Send"}></Text></button>
</form>
}

Related

Return to Assistant or the Bus UI reference.