Modals
Modals display form dialogs that collect structured user input. Modals are currently supported on Slack and Teams.
Modal
Top-level container for a form dialog. Open a modal from an onAction or onSlashCommand handler using event.openModal().
| Prop | Type | Default | Description |
|---|---|---|---|
callbackId? | string | Unique ID for routing to onModalSubmit/onModalClose handlers. | |
title? | string | Modal title displayed in the header. | |
submitLabel? | string | "Submit" | Label for the submit button. |
closeLabel? | string | "Cancel" | Label for the close/cancel button. |
notifyOnClose? | boolean | false | Whether to fire onModalClose when the user dismisses the modal. |
callbackUrl? | string | URL to POST form values to when the modal is submitted. | |
privateMetadata? | string | Arbitrary string passed through the modal lifecycle (e.g., JSON context). | |
children? | ModalChild[] | Form input elements. |
TextInput
A text input field.
| Prop | Type | Default | Description |
|---|---|---|---|
id? | string | Input ID, used as the key in event.values. | |
label? | string | Label displayed above the input. | |
placeholder? | string | Placeholder text. | |
initialValue? | string | Pre-filled value. | |
multiline? | boolean | false | Render as a textarea. |
optional? | boolean | false | Whether the field can be left empty. |
maxLength? | number | Maximum character length. |
DateInput
A date picker. Renders a Slack datepicker and an Adaptive Card Input.Date on Teams.
| Prop | Type | Default | Description |
|---|---|---|---|
id? | string | Input ID, used as the key in event.values. | |
label? | string | Label displayed above the input. | |
placeholder? | string | Placeholder text. | |
initialValue? | string | Pre-filled date as YYYY-MM-DD. | |
optional? | boolean | false | Whether the field can be left empty. |
The submitted value arrives in event.values as an ISO YYYY-MM-DD string. An initialValue that is not a valid YYYY-MM-DD date is dropped with a warning rather than forwarded, because Slack rejects a malformed initial_date by failing the whole modal.
NumberInput
A numeric input. Renders a Slack number_input and an Adaptive Card Input.Number on Teams.
| Prop | Type | Default | Description |
|---|---|---|---|
id? | string | Input ID, used as the key in event.values. | |
label? | string | Label displayed above the input. | |
placeholder? | string | Placeholder text. | |
initialValue? | number | Pre-filled value. | |
min? | number | Minimum accepted value. | |
max? | number | Maximum accepted value. | |
decimal? | boolean | false | Allow decimal values. Enforced by Slack; Adaptive Cards has no decimal switch, so Teams accepts decimals either way. |
optional? | boolean | false | Whether the field can be left empty. |
Values in event.values are always strings. Parse with Number(...) when you need a number.
Select
Dropdown menu.
| Prop | Type | Default | Description |
|---|---|---|---|
id? | string | Input ID, used as the key in event.values. | |
label? | string | Label displayed above the select. | |
placeholder? | string | Placeholder text. | |
initialOption? | string | Pre-selected option value. | |
optional? | boolean | false | Whether the field can be left empty. |
options? | SelectOptionElement[] | Select options. | |
dispatchAction? | boolean | false | Dispatch onAction events when the selection changes in a Slack modal. Ignored by other adapters. |
ExternalSelect
Dropdown that loads options dynamically from a handler as the user types. Slack-only. Pair with bot.onOptionsLoad to supply options. See Modals → ExternalSelect for a full example, grouped-options support, and Slack setup notes.
| Prop | Type | Default | Description |
|---|---|---|---|
id? | string | Input ID, used as the key in event.values. | |
label? | string | Label displayed above the select. | |
placeholder? | string | Placeholder text. | |
minQueryLength? | number | Minimum characters before the loader fires (Slack default: 3). | |
initialOption? | { label: string, value: string } | Pre-selected option when the modal opens. Unlike static Select where initialOption is a value string, ExternalSelect needs the full label/value object because the loader has not run yet. | |
optional? | boolean | false | Whether the field can be left empty. |
The loader registered via bot.onOptionsLoad("assignee", handler) returns either a flat SelectOptionElement[] or OptionsLoadGroup[] ({ label, options }[]) for grouped options.
RadioSelect
Radio button group for mutually exclusive choices.
Same props as Select (except placeholder).
SelectOption
An option used inside Select and RadioSelect.
| Prop | Type | Description |
|---|---|---|
label? | string | Display text. |
value? | string | Value sent in event.values when selected. |
description? | string | Optional description shown below the label. |
ModalChild types
The children array in Modal accepts these element types:
| Type | Created by |
|---|---|
TextInputElement | TextInput() |
DateInputElement | DateInput() |
NumberInputElement | NumberInput() |
SelectElement | Select() |
RadioSelectElement | RadioSelect() |
TextElement | Text(), for static text content |
FieldsElement | Fields(), for key-value display |
Read more
Modals
Collect structured user input through modal dialogs with text fields, dropdowns, and validation.
Overview
API reference for the Chat SDK core package.
Chat
The class that coordinates adapters, state, and event handlers for a multi-platform chat bot.
Thread
Represents a conversation thread with methods for posting, subscribing, and state management.