Back to Copilotkit

Input

showcase/shell-docs/src/content/reference/channels/components/Input.mdx

1.64.21.0 KB
Original Source

Input describes a single- or multiline text field.

tsx
import { Input, Message } from "@copilotkit/channels/ui";

<Message>
  <Input
    name="reason"
    placeholder="Why should this be approved?"
    multiline
    onSubmit={async ({ action, thread }) => {
      await thread.post(`Recorded: ${String(action.value)}`);
    }}
  />
</Message>;

Props

PropTypeDescription
namestringLogical field name.
placeholderstringNative placeholder or label text.
multilinebooleanRequests a multiline native input.
onSubmitClickHandler<string>Text submission callback where the provider dispatches it.

Managed Slack renders a dispatching plain-text input block. Managed Teams renders Input.Text, but the managed Teams ingress currently routes only Button submissions and discards other submitted card fields. Use Button.value for managed cross-provider approvals and treat Input as provider-specific until Teams field-value ingress is implemented.