- Layout Components - For organizing and structuring content (Action Rows, Sections, Containers)
- Content Components - For displaying static text, images, and files (Text Display, Media Gallery, Thumbnails)
- Interactive Components - For user interactions (Buttons, Select Menus, Text Input)
1 << 15 (IS_COMPONENTS_V2) which can be sent on a per-message basis. Once a message has been sent with this flag, it can’t be removed from that message. This enables the new components system with the following changes:
- The contentandembedsfields will no longer work but you’ll be able to use Text Display and Container as replacements
- Attachments won’t show by default - they must be exposed through components
- The pollandstickersfields are disabled
- Messages allow up to 40 total components
What is a Component
Components allow you to style and structure your messages, modals, and interactions. They are interactive elements that can create rich user experiences in your Discord applications. Components are a field on the message object and modal. You can use them when creating messages or responding to an interaction, like an application command.Component Object
Component Types
The following is a complete table of available components. Details about each component are in the sections below.| Type | Name | Description | Style | Usage | 
|---|---|---|---|---|
| 1 | Action Row | Container to display a row of interactive components | Layout | Message | 
| 2 | Button | Button object | Interactive | Message | 
| 3 | String Select | Select menu for picking from defined text options | Interactive | Message, Modal | 
| 4 | Text Input | Text input object | Interactive | Modal | 
| 5 | User Select | Select menu for users | Interactive | Message, Modal | 
| 6 | Role Select | Select menu for roles | Interactive | Message, Modal | 
| 7 | Mentionable Select | Select menu for mentionables (users and roles) | Interactive | Message, Modal | 
| 8 | Channel Select | Select menu for channels | Interactive | Message, Modal | 
| 9 | Section | Container to display text alongside an accessory component | Layout | Message | 
| 10 | Text Display | Markdown text | Content | Message, Modal | 
| 11 | Thumbnail | Small image that can be used as an accessory | Content | Message | 
| 12 | Media Gallery | Display images and other media | Content | Message | 
| 13 | File | Displays an attached file | Content | Message | 
| 14 | Separator | Component to add vertical padding between other components | Layout | Message | 
| 17 | Container | Container that visually groups a set of components | Layout | Message | 
| 18 | Label | Container associating a label and description with a component | Layout | Modal | 
Anatomy of a Component
All components have the following fields:| Field | Type | Description | 
|---|---|---|
| type | integer | The type of the component | 
| id? | integer | 32 bit integer used as an optional identifier for component | 
id field is optional and is used to identify components in the response from an interaction. The id must be unique within the message and is generated sequentially if left empty. Generation of ids won’t use another id that exists in the message if you have one defined for another component. Sending components with an id of 0 is allowed but will be treated as empty and replaced by the API.
Custom ID
Additionally, interactive components like buttons and selects must have acustom_id field. The developer defines this field when sending the component payload, and it is returned in the interaction payload sent when a user interacts with the component. For example, if you set custom_id: click_me on a button, you’ll receive an interaction containing custom_id: click_me when a user clicks that button.
custom_id is only available on interactive components and must be unique per component. Multiple components on the same message must not share the same custom_id. This field is a string of a maximum of 100 characters and can be used flexibly to maintain state or pass through other important data.
| Field | Type | Description | 
|---|---|---|
| custom_id | string | Developer-defined identifier, max 100 characters | 
Action Row
An Action Row is a top-level layout component. Action Rows can contain one of the following:- Up to 5 contextually grouped buttons
- A single select component (string select, user select, role select, mentionable select, or channel select)
Action Row Structure
| Field | Type | Description | 
|---|---|---|
| type | integer | 1for action row component | 
| id? | integer | Optional identifier for component | 
| components | array of action row child components | Up to 5 interactive button components or a single select component | 
Action Row Child Components
| Available Components | Description | 
|---|---|
| Button | An Action Row can contain up to 5 Buttons | 
| String Select | A single String Select | 
| User Select | A single User Select | 
| Role Select | A single Role Select | 
| Mentionable Select | A single Mentionable Select | 
| Channel Select | A single Channel Select | 
Examples
Message Example
Message create payload with an Action Row component
Message Example
Message create payload with an Action Row component
Rendered Example
Visualization of the message created by the payload below
Rendered Example
Visualization of the message created by the payload below

Button
A Button is an interactive component that can only be used in messages. It creates clickable elements that users can interact with, sending an interaction to your app when clicked. Buttons must be placed inside an Action Row or a Section’saccessory field.
Button Structure
| Field | Type | Description | 
|---|---|---|
| type | integer | 2for a button | 
| id? | integer | Optional identifier for component | 
| style | integer | A button style | 
| label? | string | Text that appears on the button; max 80 characters | 
| emoji? | partial emoji | name,id, andanimated | 
| custom_id | string | Developer-defined identifier for the button; max 100 characters | 
| sku_id? | snowflake | Identifier for a purchasable SKU, only available when using premium-style buttons | 
| url? | string | URL for link-style buttons; max 512 characters | 
| disabled? | boolean | Whether the button is disabled (defaults to false) | 
- Non-link and non-premium buttons must have a custom_id, and cannot have aurlor asku_id.
- Link buttons must have a url, and cannot have acustom_id
- Link buttons do not send an interaction to your app when clicked
- Premium buttons must contain a sku_id, and cannot have acustom_id,label,url, oremoji.
- Premium buttons do not send an interaction to your app when clicked
Button Styles
| Name | Value | Action | Required Field | 
|---|---|---|---|
| Primary | 1 | The most important or recommended action in a group of options | custom_id | 
| Secondary | 2 | Alternative or supporting actions | custom_id | 
| Success | 3 | Positive confirmation or completion actions | custom_id | 
| Danger | 4 | An action with irreversible consequences | custom_id | 
| Link | 5 | Navigates to a URL | url | 
| Premium | 6 | Purchase | sku_id | 
Examples
Message Example
Message create payload with a Button component
Message Example
Message create payload with a Button component
Message Interaction Response Example
When a user interacts with a Button in a message
Message Interaction Response Example
When a user interacts with a Button in a message
Button Design Guidelines
General Button Content
- 34 characters max with icon or emoji.
- 38 characters max without icon or emoji.
- Keep text concise and to the point.
- Use clear and easily understandable language. Avoid jargon or overly technical terms.
- Use verbs that indicate the outcome of the action.
- Maintain consistency in language and tone across buttons.
- Anticipate the need for translation and test for expansion or contraction in different languages.
Multiple Buttons
Use different button styles to create a hierarchy. Use only onePrimary button per group.
 If there are multiple buttons of equal significance, use the
If there are multiple buttons of equal significance, use the Secondary button style for all buttons.
 
Premium Buttons
Premium buttons will automatically have the following:- Shop Icon
- SKU name
- SKU price
 
String Select
A String Select is an interactive component that allows users to select one or more providedoptions.
String Selects can be configured for both single-select and multi-select behavior. When a user finishes making their choice(s) your app receives an interaction.
String Selects are available in messages and modals. They must be placed inside an Action Row in messages and a Label in modals.
String Select Structure
| Field | Type | Description | 
|---|---|---|
| type | integer | 3for string select | 
| id? | integer | Optional identifier for component | 
| custom_id | string | ID for the select menu; max 100 characters | 
| options | array of select options | Specified choices in a select menu; max 25 | 
| placeholder? | string | Placeholder text if nothing is selected or default; max 150 characters | 
| min_values? | integer | Minimum number of items that must be chosen (defaults to 1); min 0, max 25 | 
| max_values? | integer | Maximum number of items that can be chosen (defaults to 1); max 25 | 
| required?* | boolean | Whether the string select is required to answer in a modal (defaults to true) | 
| disabled?** | boolean | Whether select menu is disabled in a message (defaults to false) | 
required field is only available for String Selects in modals. It is ignored in messages.
** Using disabled in a modal will result in an error. Modals can not currently have disabled components in them.
Select Option Structure
| Field | Type | Description | 
|---|---|---|
| label | string | User-facing name of the option; max 100 characters | 
| value | string | Dev-defined value of the option; max 100 characters | 
| description? | string | Additional description of the option; max 100 characters | 
| emoji? | partial emoji object | id,name, andanimated | 
| default? | boolean | Will show this option as selected by default | 
String Select Interaction Response Structure
| Field | Type | Description | 
|---|---|---|
| type* | integer | 3for a String Select | 
| component_type* | integer | 3for a String Select | 
| id | integer | Unique identifier for the component | 
| custom_id | string | Developer-defined identifier for the input; max 100 characters | 
| values | array of strings | The text of the selected options | 
component_type will be returned and in modal interaction responses type will be returned.
Examples
Message Example
Message create payload with a String Select component
Message Example
Message create payload with a String Select component
Rendered Example
Visualization of the message created by the payload below
Rendered Example
Visualization of the message created by the payload below

Message Interaction Data Example
When a user interacts with a StringSelect in a message
Message Interaction Data Example
When a user interacts with a StringSelect in a message
Modal Example
Modal create payload with a String Select component
Modal Example
Modal create payload with a String Select component
Rendered Example
Visualization of the message created by the payload below
Rendered Example
Visualization of the message created by the payload below

Modal Submit Interaction Data Example
When a user submits a modal containing a String Select
Modal Submit Interaction Data Example
When a user submits a modal containing a String Select
Text Input
Text Input is an interactive component that allows users to enter free-form text responses in modals. It supports both short, single-line inputs and longer, multi-line paragraph inputs. Text Inputs can only be used within modals and must be placed inside a Label.Text Input Structure
| Field | Type | Description | 
|---|---|---|
| type | integer | 4for a text input | 
| id? | integer | Optional identifier for component | 
| custom_id | string | Developer-defined identifier for the input; max 100 characters | 
| style | integer | The Text Input Style | 
| min_length? | integer | Minimum input length for a text input; min 0, max 4000 | 
| max_length? | integer | Maximum input length for a text input; min 1, max 4000 | 
| required? | boolean | Whether this component is required to be filled (defaults to true) | 
| value? | string | Pre-filled value for this component; max 4000 characters | 
| placeholder? | string | Custom placeholder text if the input is empty; max 100 characters | 
label field on a Text Input is deprecated in favor of label and description on the Label component.Text Input Styles
| Name | Value | Description | 
|---|---|---|
| Short | 1 | Single-line input | 
| Paragraph | 2 | Multi-line input | 
Text Input Interaction Response Structure
| Field | Type | Description | 
|---|---|---|
| type | integer | 4for a Text Input | 
| id | integer | Unique identifier for the component | 
| custom_id | string | Developer-defined identifier for the input; max 100 characters | 
| value | string | The user’s input text | 
Examples
Modal Example
Modal create payload with a Text Input component
Modal Example
Modal create payload with a Text Input component
Rendered Example
Visualization of the modal created by the payload below
Rendered Example
Visualization of the modal created by the payload below

Modal Submit Interaction Data Example
When a user submits a modal containing a TextInput
Modal Submit Interaction Data Example
When a user submits a modal containing a TextInput
User Select
A User Select is an interactive component that allows users to select one or more users in a message or modal. Options are automatically populated based on the server’s available users. User Selects can be configured for both single-select and multi-select behavior. When a user finishes making their choice(s) your app receives an interaction. User Selects are available in messages and modals. They must be placed inside an Action Row in messages and a Label in modals.User Select Structure
| Field | Type | Description | 
|---|---|---|
| type | integer | 5for user select | 
| id? | integer | Optional identifier for component | 
| custom_id | string | ID for the select menu; max 100 characters | 
| placeholder? | string | Placeholder text if nothing is selected; max 150 characters | 
| default_values? | array of default value objects | List of default values for auto-populated select menu components; number of default values must be in the range defined by min_valuesandmax_values | 
| min_values? | integer | Minimum number of items that must be chosen (defaults to 1); min 0, max 25 | 
| max_values? | integer | Maximum number of items that can be chosen (defaults to 1); max 25 | 
| required?* | boolean | Whether the user select is required to answer in a modal (defaults to true) | 
| disabled?** | boolean | Whether select menu is disabled in a message (defaults to false) | 
required field is only available for User Selects in modals. It is ignored in messages.
** Using disabled in a modal will result in an error. Modals can not currently have disabled components in them.
Select Default Value Structure
| Field | Type | Description | 
|---|---|---|
| id | snowflake | ID of a user, role, or channel | 
| type | string | Type of value that idrepresents. Either"user","role", or"channel" | 
User Select Interaction Response Structure
| Field | Type | Description | 
|---|---|---|
| type* | integer | 5for a User Select | 
| component_type* | integer | 5for a User Select | 
| id | integer | Unique identifier for the component | 
| custom_id | string | Developer-defined identifier for the input; max 100 characters | 
| resolved | resolved data | Resolved entities from selected options | 
| values | array of snowflakes | IDs of the selected users | 
component_type will be returned and in modal interaction responses type will be returned.
Examples
Message Example
Message create payload with a User Select component
Message Example
Message create payload with a User Select component
Rendered Example
Visualization of the message created by the payload below
Rendered Example
Visualization of the message created by the payload below

Message Interaction Data Example
When a user interacts with a User Select in a message
Message Interaction Data Example
When a user interacts with a User Select in a message
members and users may both be present in the resolved object when a user is selected.Modal Example
Modal create payload with a User Select component
Modal Example
Modal create payload with a User Select component
Rendered Example
Visualization of the message created by the payload below
Rendered Example
Visualization of the message created by the payload below

Modal Submit Interaction Data Example
When a user submits a modal containing a User Select
Modal Submit Interaction Data Example
When a user submits a modal containing a User Select
Role Select
A Role Select is an interactive component that allows users to select one or more roles in a message or modal. Options are automatically populated based on the server’s available roles. Role Selects can be configured for both single-select and multi-select behavior. When a user finishes making their choice(s) your app receives an interaction. Role Selects are available in messages and modals. They must be placed inside an Action Row in messages and a Label in modals.Role Select Structure
| Field | Type | Description | 
|---|---|---|
| type | integer | 6for role select | 
| id? | integer | Optional identifier for component | 
| custom_id | string | ID for the select menu; max 100 characters | 
| placeholder? | string | Placeholder text if nothing is selected; max 150 characters | 
| default_values? | array of default value objects | List of default values for auto-populated select menu components; number of default values must be in the range defined by min_valuesandmax_values | 
| min_values? | integer | Minimum number of items that must be chosen (defaults to 1); min 0, max 25 | 
| max_values? | integer | Maximum number of items that can be chosen (defaults to 1); max 25 | 
| required?* | boolean | Whether the role select is required to answer in a modal (defaults to true) | 
| disabled?** | boolean | Whether select menu is disabled in a message (defaults to false) | 
required field is only available for Role Selects in modals. It is ignored in messages.
** Using disabled in a modal will result in an error. Modals can not currently have disabled components in them.
Role Select Interaction Response Structure
| Field | Type | Description | 
|---|---|---|
| type* | integer | 6for a Role Select | 
| component_type* | integer | 6for a Role Select | 
| id | integer | Unique identifier for the component | 
| custom_id | string | Developer-defined identifier for the input; max 100 characters | 
| resolved | resolved data | Resolved entities from selected options | 
| values | array of snowflakes | IDs of the selected roles | 
component_type will be returned and in modal interaction responses type will be returned.
Examples
Message Example
Message create payload with a Role Select component
Message Example
Message create payload with a Role Select component
Rendered Example
Visualization of the message created by the payload below
Rendered Example
Visualization of the message created by the payload below

Message Interaction Data Example
When a user interacts with a Role Select in a message
Message Interaction Data Example
When a user interacts with a Role Select in a message
Modal Example
Modal create payload with a Role Select component
Modal Example
Modal create payload with a Role Select component
Rendered Example
Visualization of the message created by the payload below
Rendered Example
Visualization of the message created by the payload below

Modal Submit Interaction Data Example
When a user submits a modal containing a Role Select
Modal Submit Interaction Data Example
When a user submits a modal containing a Role Select
Mentionable Select
A Mentionable Select is an interactive component that allows users to select one or more mentionables in a message or modal. Options are automatically populated based on available mentionables in the server. Mentionable Selects can be configured for both single-select and multi-select behavior. When a user finishes making their choice(s), your app receives an interaction. Mentionable Selects are available in messages and modals. They must be placed inside an Action Row in messages and a Label in modals.Mentionable Select Structure
| Field | Type | Description | 
|---|---|---|
| type | integer | 7for mentionable select | 
| id? | integer | Optional identifier for component | 
| custom_id | string | ID for the select menu; max 100 characters | 
| placeholder? | string | Placeholder text if nothing is selected; max 150 characters | 
| default_values? | array of default value objects | List of default values for auto-populated select menu components; number of default values must be in the range defined by min_valuesandmax_values | 
| min_values? | integer | Minimum number of items that must be chosen (defaults to 1); min 0, max 25 | 
| max_values? | integer | Maximum number of items that can be chosen (defaults to 1); max 25 | 
| required?* | boolean | Whether the mentionable select is required to answer in a modal (defaults to true) | 
| disabled?** | boolean | Whether select menu is disabled in a message (defaults to false) | 
required field is only available for Mentionable Selects in modals. It is ignored in messages.
** Using disabled in a modal will result in an error. Modals can not currently have disabled components in them.
Mentionable Select Interaction Response Structure
| Field | Type | Description | 
|---|---|---|
| type* | integer | 7for a Mentionable Select | 
| component_type* | integer | 7for a Mentionable Select | 
| id | integer | Unique identifier for the component | 
| custom_id | string | Developer-defined identifier for the input; max 100 characters | 
| resolved | resolved data | Resolved entities from selected options | 
| values | array of snowflakes | IDs of the selected mentionables | 
component_type will be returned and in modal interaction responses type will be returned.
Examples
Message Example
Message create payload with a Mentionable Select component
Message Example
Message create payload with a Mentionable Select component
Rendered Example
Visualization of the message created by the payload below
Rendered Example
Visualization of the message created by the payload below

Message Interaction Data Example
When a user interacts with a Mentionable Select in a message
Message Interaction Data Example
When a user interacts with a Mentionable Select in a message
members and users may both be present in the resolved object when a user is selected.Modal Example
Modal create payload with a Mentionable Select component
Modal Example
Modal create payload with a Mentionable Select component
Rendered Example
Visualization of the message created by the payload below
Rendered Example
Visualization of the message created by the payload below

Modal Submit Interaction Data Example
When a user submits a modal containing a Mentionable Select
Modal Submit Interaction Data Example
When a user submits a modal containing a Mentionable Select
Channel Select
A Channel Select is an interactive component that allows users to select one or more channels in a message or modal. Options are automatically populated based on available channels in the server and can be filtered by channel types. Channel Selects can be configured for both single-select and multi-select behavior. When a user finishes making their choice(s) your app receives an interaction. Channel Selects are available in messages and modals. They must be placed inside an Action Row in messages and a Label in modals.Channel Select Structure
| Field | Type | Description | 
|---|---|---|
| type | integer | 8for channel select | 
| id? | integer | Optional identifier for component | 
| custom_id | string | ID for the select menu; max 100 characters | 
| channel_types? | array of channel types | List of channel types to include in the channel select component | 
| placeholder? | string | Placeholder text if nothing is selected; max 150 characters | 
| default_values? | array of default value objects | List of default values for auto-populated select menu components; number of default values must be in the range defined by min_valuesandmax_values | 
| min_values? | integer | Minimum number of items that must be chosen (defaults to 1); min 0, max 25 | 
| max_values? | integer | Maximum number of items that can be chosen (defaults to 1); max 25 | 
| required?* | boolean | Whether the channel select is required to answer in a modal (defaults to true) | 
| disabled?** | boolean | Whether select menu is disabled in a message (defaults to false) | 
required field is only available for Channel Selects in modals. It is ignored in messages.
** Using disabled in a modal will result in an error. Modals can not currently have disabled components in them.
Channel Select Interaction Response Structure
| Field | Type | Description | 
|---|---|---|
| type* | integer | 8for a Channel Select | 
| component_type* | integer | 8for a Channel Select | 
| id | integer | Unique identifier for the component | 
| custom_id | string | Developer-defined identifier for the input; max 100 characters | 
| resolved | resolved data | Resolved entities from selected options | 
| values | array of snowflakes | IDs of the selected channels | 
component_type will be returned and in modal interaction responses type will be returned.
Examples
Message Example
Message create payload with a Channel Select component
Message Example
Message create payload with a Channel Select component
Rendered Example
Visualization of the message created by the payload below
Rendered Example
Visualization of the message created by the payload below

Message Interaction Data Example
When a user interacts with a Channel Select in a message
Message Interaction Data Example
When a user interacts with a Channel Select in a message
Modal Example
Modal create payload with a Channel Select component
Modal Example
Modal create payload with a Channel Select component
Rendered Example
Visualization of the message created by the payload below
Rendered Example
Visualization of the message created by the payload below

Modal Submit Interaction Data Example
When a user submits a modal containing a Channel Select
Modal Submit Interaction Data Example
When a user submits a modal containing a Channel Select
Section
A Section is a top-level layout component that allows you to contextually associate content with an accessory component. The typical use-case is to contextually associate text content with an accessory. Sections are currently only available in messages.1 << 15 (IS_COMPONENTS_V2) which can be activated on a per-message basis.Section Structure
| Field | Type | Description | 
|---|---|---|
| type | integer | 9for section component | 
| id? | integer | Optional identifier for component | 
| components | array of section child components | One to three child components representing the content of the section that is contextually associated to the accessory | 
| accessory | section accessory component | A component that is contextually associated to the content of the section | 
components to contain only text components. We may add other components in the future. Similarly, accessory may be expanded to include other components in the future.Section Child Components
| Available Components | 
|---|
| Text Display | 
Section Accessory Components
Examples
Message Example
Message create payload with a Section (and Thumbnail) component
Message Example
Message create payload with a Section (and Thumbnail) component
Rendered Example
Visualization of the message created by the payload below
Rendered Example
Visualization of the message created by the payload below

Text Display
A Text Display is a content component that allows you to add markdown formatted text, including mentions (users, roles, etc) and emojis. The behavior of this component is extremely similar to thecontent field of a message, but allows you to add multiple text components, controlling the layout of your message.
When sent in a message, pingable mentions (@user, @role, etc) present in this component will ping and send notifications based on the
value of the allowed mention object set in message.allowed_mentions.
1 << 15 (IS_COMPONENTS_V2) which can be activated on a per-message basis.Text Display Structure
| Field | Type | Description | 
|---|---|---|
| type | integer | 10for text display | 
| id? | integer | Optional identifier for component | 
| content | string | Text that will be displayed similar to a message | 
Text Display Interaction Response Structure
| Field | Type | Description | 
|---|---|---|
| type | integer | 10for a Text Display | 
| id | integer | Unique identifier for the component | 
Examples
Message Example
Message create payload with a Text Display component
Message Example
Message create payload with a Text Display component
Rendered Example
Visualization of the message created by the payload below
Rendered Example
Visualization of the message created by the payload below

Modal Example
Modal create payload with a Text Display component
Modal Example
Modal create payload with a Text Display component
Rendered Example
Visualization of the message created by the payload below
Rendered Example
Visualization of the message created by the payload below

Thumbnail
A Thumbnail is a content component that displays visual media in a small form-factor. It is intended as an accessory for to other content, and is primarily usable with sections. The media displayed is defined by the unfurled media item structure, which supports both uploaded media and externally hosted media. Thumbnails are currently only available in messages as an accessory in a section. Thumbnails currently only support images, including animated formats like GIF and WEBP. Videos are not supported at this time.1 << 15 (IS_COMPONENTS_V2), which can be activated on a per-message basis.Thumbnail Structure
| Field | Type | Description | 
|---|---|---|
| type | integer | 11for thumbnail component | 
| id? | integer | Optional identifier for component | 
| media | unfurled media item | A url or attachment provided as an unfurled media item | 
| description? | string | Alt text for the media, max 1024 characters | 
| spoiler? | boolean | Whether the thumbnail should be a spoiler (or blurred out). Defaults to false | 
Examples
Message Example
Message create payload with a Thumbnail component (via Section)
Message Example
Message create payload with a Thumbnail component (via Section)
Rendered Example
Visualization of the message created by the payload below
Rendered Example
Visualization of the message created by the payload below

Media Gallery
A Media Gallery is a top-level content component that allows you to display 1-10 media attachments in an organized gallery format. Each item can have optional descriptions and can be marked as spoilers. Media Galleries are currently only available in messages.1 << 15 (IS_COMPONENTS_V2) which can be activated on a per-message basis.Media Gallery Structure
| Field | Type | Description | 
|---|---|---|
| type | integer | 12for media gallery component | 
| id? | integer | Optional identifier for component | 
| items | array of media gallery items | 1 to 10 media gallery items | 
Media Gallery Item Structure
| Field | Type | Description | 
|---|---|---|
| media | unfurled media item | A url or attachment provided as an unfurled media item | 
| description? | string | Alt text for the media, max 1024 characters | 
| spoiler? | boolean | Whether the media should be a spoiler (or blurred out). Defaults to false | 
Examples
Message Example
Message create payload with a Media Gallery component
Message Example
Message create payload with a Media Gallery component
Rendered Example
Visualization of the message created by the payload below
Rendered Example
Visualization of the message created by the payload below

File
A File is a top-level content component that allows you to display an uploaded file as an attachment to the message and reference it in the component. Each file component can only display 1 attached file, but you can upload multiple files and add them to different file components within your payload. Files are currently only available in messages.attachment:// protocol in unfurled media item1 << 15 (IS_COMPONENTS_V2) which can be activated on a per-message basis.File Structure
| Field | Type | Description | 
|---|---|---|
| type | integer | 13for a file component | 
| id? | integer | Optional identifier for component | 
| file | unfurled media item | This unfurled media item is unique in that it only supports attachment references using the attachment://<filename>syntax | 
| spoiler? | boolean | Whether the media should be a spoiler (or blurred out). Defaults to false | 
| name | string | The name of the file. This field is ignored and provided by the API as part of the response | 
| size | integer | The size of the file in bytes. This field is ignored and provided by the API as part of the response | 
Examples
Message Example
Message create payload with a File component
Message Example
Message create payload with a File component
Rendered Example
Visualization of the message created by the payload below
Rendered Example
Visualization of the message created by the payload below

attachment:// protocol functionality in unfurled media item.Separator
A Separator is a top-level layout component that adds vertical padding and visual division between other components. Separators are currently only available in messages.1 << 15 (IS_COMPONENTS_V2) which can be activated on a per-message basis.Separator Structure
| Field | Type | Description | 
|---|---|---|
| type | integer | 14for separator component | 
| id? | integer | Optional identifier for component | 
| divider? | boolean | Whether a visual divider should be displayed in the component. Defaults to true | 
| spacing? | integer | Size of separator padding— 1for small padding,2for large padding. Defaults to1 | 
Examples
Message Example
Message create payload with a Separator component
Message Example
Message create payload with a Separator component
Rendered Example
Visualization of the message created by the payload below
Rendered Example
Visualization of the message created by the payload below

Container
A Container is a top-level layout component. Containers offer the ability to visually encapsulate a collection of components and have an optional customizable accent color bar. Containers are currently only available in messages.1 << 15 (IS_COMPONENTS_V2) which can be activated on a per-message basis.Container Structure
| Field | Type | Description | 
|---|---|---|
| type | integer | 17for container component | 
| id? | integer | Optional identifier for component | 
| components | array of container child components | Child components that are encapsulated within the Container | 
| accent_color? | ?integer | Color for the accent on the container as RGB from 0x000000to0xFFFFFF | 
| spoiler? | boolean | Whether the container should be a spoiler (or blurred out). Defaults to false. | 
Container Child Components
| Available Components | 
|---|
| Action Row | 
| Text Display | 
| Section | 
| Media Gallery | 
| Separator | 
| File | 
Examples
Message Example
Message create payload with a Container component
Message Example
Message create payload with a Container component
Rendered Example
Visualization of the message created by the payload below
Rendered Example
Visualization of the message created by the payload below

Label
A Label is a top-level layout component. Labels wrap modal components with text as a label and optional description.description may display above or below the component depending on the platform.Label Structure
| Field | Type | Description | 
|---|---|---|
| type | integer | 18for a label | 
| id? | integer | Optional identifier for component | 
| label | string | The label text; max 45 characters | 
| description? | string | An optional description text for the label; max 100 characters | 
| component | label child component | The component within the label | 
Label Child Components
| Available Components | 
|---|
| Text Input | 
| String Select | 
| User Select | 
| Role Select | 
| Mentionable Select | 
| Channel Select | 
Label Interaction Response Structure
| Field | Type | Description | 
|---|---|---|
| type | integer | 18for a Label | 
| id | integer | Unique identifier for the component | 
| component | label interaction response child component | The component within the label | 
Label Interaction Response Child Components
| Available Components | 
|---|
| Text Input | 
| String Select | 
| User Select | 
| Role Select | 
| Mentionable Select | 
| Channel Select | 
Examples
Modal Example
Modal create payload with a Label component (wrapping a Text Input)
Modal Example
Modal create payload with a Label component (wrapping a Text Input)
Rendered Example
Visualization of the modal created by the payload below
Rendered Example
Visualization of the modal created by the payload below

Unfurled Media Item
An Unfurled Media Item is a piece of media, represented by a URL, that is used within a component. It can be constructed via either uploading media to Discord, or by referencing external media via a direct link to the asset.url field is settable by developers when making requests that utilize this structure.All other fields will be automatically populated by Discord.Unfurled Media Item Structure
| Field | Type | Description | 
|---|---|---|
| url | string | Supports arbitrary urls and attachment://<filename>references | 
| proxy_url? | string | The proxied url of the media item. This field is ignored and provided by the API as part of the response | 
| height? | ?integer | The height of the media item. This field is ignored and provided by the API as part of the response | 
| width? | ?integer | The width of the media item. This field is ignored and provided by the API as part of the response | 
| content_type? | string | The media type of the content. This field is ignored and provided by the API as part of the response | 
| attachment_id?* | snowflake | The id of the uploaded attachment. This field is ignored and provided by the API as part of the response | 
Uploading a file
To upload a file with your message, you’ll need to send your payload asmultipart/form-data (rather than application/json) and include your file with a valid filename in your payload. Details and examples for uploading files can be found in the API Reference.
Legacy Message Component Behavior
Before the introduction of theIS_COMPONENTS_V2 flag (see changelog), message components were sent in conjunction with message content. This means that you could send a message using a subset of the available components without setting the IS_COMPONENTS_V2 flag, and the components would be included in the message content along with content and embeds.
Additionally, components of messages preceding components V2 will contain an id of 0.
Apps using this Legacy Message Component behavior will continue to work as expected, but it is recommended to use the new IS_COMPONENTS_V2 flag for new apps or features as they offer more options for layout and customization.