Back to Copilotkit

Modal

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

1.64.21.4 KB
Original Source

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

tsx
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>;
<Callout type="warn" title="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. </Callout>
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.

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