Modal

Reference for the exported modal component vocabulary and its managed Channels availability.

The UI package exports Modal, TextInput, ModalSelect, ModalSelectOption, and RadioButtons for adapters with modal support.

import {
  Modal,
  ModalSelect,
  ModalSelectOption,
  TextInput,
} from "@copilotkit/channels/ui";

<Modal callbackId="triage" title="Triage incident" submitLabel="Assign">
  <TextInput id="summary" label="Summary" multiline />
  <ModalSelect id="owner" label="Owner">
    <ModalSelectOption label="Payments" value="payments" />
  </ModalSelect>
</Modal>;

Not available on managed Slack or Teams

The Intelligence adapter reports supportsModals: false; managed interaction contexts do not expose openModal, and managed ingress does not deliver modal submit or close events. Use a posted Button card and a later thread.resume(value) instead.

PropTypeDescription
callbackIdstringStable id for submit and close routing.
titlestringModal title.
submitLabelstringOptional submit label.
closeLabelstringOptional close label.
notifyOnClosebooleanRequests a close event on supporting adapters.
privateMetadatastringOpaque metadata echoed to submit or close handlers.
childrenBotChildrenModal input components.

TextInput props

PropTypeDescription
idstringRequired. Key of this input in values of the submit event.
labelstringRequired. Label shown above the input.
placeholderstringOptional placeholder text.
multilinebooleanShows a multi-line text area.
optionalbooleanLets the user submit without a value.
maxLengthnumberOptional maximum length of the value.
initialValuestringOptional value shown when the modal opens.

ModalSelect props

PropTypeDescription
idstringRequired. Key of this input in values of the submit event.
labelstringRequired. Label shown above the select.
placeholderstringOptional placeholder text.
optionalbooleanLets the user submit without a choice.
initialOptionstringvalue of the option selected by default.
childrenBotChildrenModalSelectOption elements.

ModalSelectOption props

PropTypeDescription
labelstringRequired. Text of the option.
valuestringRequired. Value sent to the submit handler.

RadioButtons props

PropTypeDescription
idstringRequired. Key of this input in values of the submit event.
labelstringRequired. Label shown above the buttons.
optionalbooleanLets the user submit without a choice.
initialOptionstringvalue of the option selected by default.
childrenBotChildrenModalSelectOption elements, one for each button.

These components remain public for direct adapters. They are reference-only for the managed Slack and Teams setup documented here.

How is this guide?