Component Reference
This document serves as a comprehensive reference for all available components. It covers three main categories:
- 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)
To use these components, you need to send the message flag 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
content and embeds fields 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
poll and stickers fields are disabled
- Messages allow up to 40 total components
For a practical guide on implementing these components, see our Using Message Components and Using Modal Components documentation.
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 |
| 19 | File Upload | Component for uploading files | Interactive | 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 |
The 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 a custom_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 1 to 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, 1-100 characters |
Action Row
An Action Row is a top-level layout component.
Action Rows can contain one of the following:
Label is recommended for use over an Action Row in modals. Action Row with Text Inputs in modals are now deprecated.
Action Row Structure
| Field | Type | Description |
|---|
| type | integer | 1 for 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
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’s accessory field.
Button Structure
| Field | Type | Description |
|---|
| type | integer | 2 for 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, and animated |
| custom_id | string | Developer-defined identifier for the button; 1-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) |
Buttons come in various styles to convey different types of actions. These styles also define what fields are valid for a button.
- Non-link and non-premium buttons must have a
custom_id, and cannot have a url or a sku_id.
- Link buttons must have a
url, and cannot have a custom_id
- Link buttons do not send an interaction to your app when clicked
- Premium buttons must contain a
sku_id, and cannot have a custom_id, label, url, or emoji.
- 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
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 one Primary button per group.
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 provided options.
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 | 3 for string select |
| id? | integer | Optional identifier for component |
| custom_id | string | ID for the select menu; 1-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) |
* The 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, and animated |
| default? | boolean | Will show this option as selected by default |
String Select Interaction Response Structure
| Field | Type | Description |
|---|
| type* | integer | 3 for a String Select |
| component_type* | integer | 3 for a String Select |
| id | integer | Unique identifier for the component |
| custom_id | string | Developer-defined identifier for the input; 1-100 characters |
| values | array of strings | The text of the selected options |
* In message interaction responses component_type will be returned and in modal interaction responses type will be returned.
Examples
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.
We no longer recommend using Text Input within an Action Row in modals. Going forward all Text Inputs should be placed inside a Label component.
Text Input Structure
| Field | Type | Description |
|---|
| type | integer | 4 for a text input |
| id? | integer | Optional identifier for component |
| custom_id | string | Developer-defined identifier for the input; 1-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 |
The 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 | 4 for a Text Input |
| id | integer | Unique identifier for the component |
| custom_id | string | Developer-defined identifier for the input; 1-100 characters |
| value | string | The user’s input text |
Examples
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 | 5 for user select |
| id? | integer | Optional identifier for component |
| custom_id | string | ID for the select menu; 1-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_values and max_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) |
* The 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 id represents. Either "user", "role", or "channel" |
User Select Interaction Response Structure
| Field | Type | Description |
|---|
| type* | integer | 5 for a User Select |
| component_type* | integer | 5 for a User Select |
| id | integer | Unique identifier for the component |
| custom_id | string | Developer-defined identifier for the input; 1-100 characters |
| resolved | resolved data | Resolved entities from selected options |
| values | array of snowflakes | IDs of the selected users |
* In message interaction responses component_type will be returned and in modal interaction responses type will be returned.
Examples
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 | 6 for role select |
| id? | integer | Optional identifier for component |
| custom_id | string | ID for the select menu; 1-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_values and max_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) |
* The 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 | 6 for a Role Select |
| component_type* | integer | 6 for a Role Select |
| id | integer | Unique identifier for the component |
| custom_id | string | Developer-defined identifier for the input; 1-100 characters |
| resolved | resolved data | Resolved entities from selected options |
| values | array of snowflakes | IDs of the selected roles |
* In message interaction responses component_type will be returned and in modal interaction responses type will be returned.
Examples
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 | 7 for mentionable select |
| id? | integer | Optional identifier for component |
| custom_id | string | ID for the select menu; 1-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_values and max_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) |
* The 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 | 7 for a Mentionable Select |
| component_type* | integer | 7 for a Mentionable Select |
| id | integer | Unique identifier for the component |
| custom_id | string | Developer-defined identifier for the input; 1-100 characters |
| resolved | resolved data | Resolved entities from selected options |
| values | array of snowflakes | IDs of the selected mentionables |
* In message interaction responses component_type will be returned and in modal interaction responses type will be returned.
Examples
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 | 8 for channel select |
| id? | integer | Optional identifier for component |
| custom_id | string | ID for the select menu; 1-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_values and max_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) |
* The 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 | 8 for a Channel Select |
| component_type* | integer | 8 for a Channel Select |
| id | integer | Unique identifier for the component |
| custom_id | string | Developer-defined identifier for the input; 1-100 characters |
| resolved | resolved data | Resolved entities from selected options |
| values | array of snowflakes | IDs of the selected channels |
* In message interaction responses component_type will be returned and in modal interaction responses type will be returned.
Examples
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.
To use this component in messages you must send the message flag 1 << 15 (IS_COMPONENTS_V2) which can be activated on a per-message basis.
Section Structure
| Field | Type | Description |
|---|
| type | integer | 9 for 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 |
Don’t hardcode 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
| Available Components |
|---|
| Button |
| Thumbnail |
Examples
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 the content 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.
To use this component in messages you must send the message flag 1 << 15 (IS_COMPONENTS_V2) which can be activated on a per-message basis.
Text Display Structure
| Field | Type | Description |
|---|
| type | integer | 10 for 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 | 10 for a Text Display |
| id | integer | Unique identifier for the component |
Examples
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.
To use this component, you need to send the message flag 1 << 15 (IS_COMPONENTS_V2), which can be activated on a per-message basis.
Thumbnail Structure
| Field | Type | Description |
|---|
| type | integer | 11 for 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
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.
To use this component in messages you must send the message flag 1 << 15 (IS_COMPONENTS_V2) which can be activated on a per-message basis.
Media Gallery Structure
| Field | Type | Description |
|---|
| type | integer | 12 for 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
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.
To use this component in messages you must send the message flag 1 << 15 (IS_COMPONENTS_V2) which can be activated on a per-message basis.
File Structure
| Field | Type | Description |
|---|
| type | integer | 13 for 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
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.
To use this component in messages you must send the message flag 1 << 15 (IS_COMPONENTS_V2) which can be activated on a per-message basis.
Separator Structure
| Field | Type | Description |
|---|
| type | integer | 14 for 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—1 for small padding, 2 for large padding. Defaults to 1 |
Examples
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.
To use this component in messages you must send the message flag 1 << 15 (IS_COMPONENTS_V2) which can be activated on a per-message basis.
Container Structure
| Field | Type | Description |
|---|
| type | integer | 17 for 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 0x000000 to 0xFFFFFF |
| spoiler? | boolean | Whether the container should be a spoiler (or blurred out). Defaults to false. |
Container Child Components
Examples
Label
A Label is a top-level layout component. Labels wrap modal components with text as a label and optional description.
The description may display above or below the component depending on the platform.
Label Structure
| Field | Type | Description |
|---|
| type | integer | 18 for 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
Label Interaction Response Structure
| Field | Type | Description |
|---|
| type | integer | 18 for 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
Examples
File Upload
File Upload is an interactive component that allows users to upload files in modals. File Uploads can be configured to have a minimum and maximum number of files between 0 and 10, along with required for if the upload is required to submit the modal. The max file size a user can upload is based on the user’s upload limit in that channel.
File Uploads are available on modals. They must be placed inside a Label.
File Upload Structure
| Field | Type | Description |
|---|
| type | integer | 19 for file upload |
| id? | integer | Optional identifier for component |
| custom_id | string | ID for the file upload; 1-100 characters |
| min_values? | integer | Minimum number of items that must be uploaded (defaults to 1); min 0, max 10 |
| max_values? | integer | Maximum number of items that can be uploaded (defaults to 1); max 10 |
| required? | boolean | Whether the file upload requires files to be uploaded before submitting the modal (defaults to true) |
File Upload Interaction Response Structure
| Field | Type | Description |
|---|
| type | integer | 19 for a File Upload |
| id | integer | Unique identifier for the component |
| custom_id | string | Developer-defined identifier for the input; 1-100 characters |
| values | array of snowflakes | IDs of the uploaded files found in the resolved data |
Examples
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.
While the structure below is the full representation of an Unfurled Media Item,
only the 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 |
* Only present if the media item was uploaded as an attachment.
Uploading a file
To upload a file with your message, you’ll need to send your payload as multipart/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 the IS_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.
Legacy messages allow up to 5 action rows as top-level components
Legacy Message Component Example
{
"content": "This is a message with legacy components",
"components": [
{
"type": 1,
"components": [
{
"type": 2,
"style": 1,
"label": "Click Me",
"custom_id": "click_me_1"
}
]
}
]
}