Skip to main content
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
Legacy component behavior will continue to work but provide less flexibility and control over the message layout.
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.
TypeNameDescriptionStyleUsage
1Action RowContainer to display a row of interactive componentsLayoutMessage
2ButtonButton objectInteractiveMessage
3String SelectSelect menu for picking from defined text optionsInteractiveMessage, Modal
4Text InputText input objectInteractiveModal
5User SelectSelect menu for usersInteractiveMessage, Modal
6Role SelectSelect menu for rolesInteractiveMessage, Modal
7Mentionable SelectSelect menu for mentionables (users and roles)InteractiveMessage, Modal
8Channel SelectSelect menu for channelsInteractiveMessage, Modal
9SectionContainer to display text alongside an accessory componentLayoutMessage
10Text DisplayMarkdown textContentMessage, Modal
11ThumbnailSmall image that can be used as an accessoryContentMessage
12Media GalleryDisplay images and other mediaContentMessage
13FileDisplays an attached fileContentMessage
14SeparatorComponent to add vertical padding between other componentsLayoutMessage
17ContainerContainer that visually groups a set of componentsLayoutMessage
18LabelContainer associating a label and description with a componentLayoutModal

Anatomy of a Component

All components have the following fields:
FieldTypeDescription
typeintegerThe type of the component
id?integer32 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 a maximum of 100 characters and can be used flexibly to maintain state or pass through other important data.
FieldTypeDescription
custom_idstringDeveloper-defined identifier, max 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
FieldTypeDescription
typeinteger1 for action row component
id?integerOptional identifier for component
componentsarray of action row child componentsUp to 5 interactive button components or a single select component
Action Row Child Components
Available ComponentsDescription
ButtonAn Action Row can contain up to 5 Buttons
String SelectA single String Select
User SelectA single User Select
Role SelectA single Role Select
Mentionable SelectA single Mentionable Select
Channel SelectA single Channel Select
Examples
Example of an Action Row with three buttons
{
  "flags": 32768,
  "components": [
    {
      "type": 1,  // ComponentType.ACTION_ROW
      "components": [
        {
          "type": 2,  // ComponentType.BUTTON
          "custom_id": "click_yes"
          "label": "Accept",
          "style": 1,
        },
        {
          "type": 2,  // ComponentType.BUTTON
          "label": "Learn More",
          "style": 5,
          "url": "http://watchanimeattheoffice.com/"
        },
        {
          "type": 2,  // ComponentType.BUTTON
          "custom_id": "click_no"
          "label": "Decline",
          "style": 4,
        }
      ]
    }
  ]
}

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’s accessory field.
Button Structure
FieldTypeDescription
typeinteger2 for a button
id?integerOptional identifier for component
styleintegerA button style
label?stringText that appears on the button; max 80 characters
emoji?partial emojiname, id, and animated
custom_idstringDeveloper-defined identifier for the button; max 100 characters
sku_id?snowflakeIdentifier for a purchasable SKU, only available when using premium-style buttons
url?stringURL for link-style buttons; max 512 characters
disabled?booleanWhether 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
NameValueActionRequired Field
Primary1The most important or recommended action in a group of optionscustom_id
Secondary2Alternative or supporting actionscustom_id
Success3Positive confirmation or completion actionscustom_id
Danger4An action with irreversible consequencescustom_id
Link5Navigates to a URLurl
Premium6Purchasesku_id
Examples
{
  "flags": 32768,
  "components": [
    {
      "type": 1,  // ComponentType.ACTION_ROW
      "components": [
          {
            "type": 2,  // ComponentType.BUTTON,
            "custom_id": "click_me"
            "label": "Click me!",
            "style": 1,
          }
      ]
    }
  ]
}
When a user interacts with a Button in a message, this is the basic form of the interaction data payload you will receive. The full payload is available in the interaction reference.
{
  "type": 3, // InteractionType.MESSAGE_COMPONENT
  ...additionalInteractionFields, // See the Interaction documentation for all fields

  "data": {
    "component_type": 2, // ComponentType.BUTTON
    "id": 2,
    "custom_id": "click_me",
  },
}

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 one Primary button per group. Example showing one primary button per button group If there are multiple buttons of equal significance, use the Secondary button style for all buttons. Example showing multiple buttons in a group with equal significance
Premium Buttons
Premium buttons will automatically have the following:
  • Shop Icon
  • SKU name
  • SKU price
A premium button

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
FieldTypeDescription
typeinteger3 for string select
id?integerOptional identifier for component
custom_idstringID for the select menu; max 100 characters
optionsarray of select optionsSpecified choices in a select menu; max 25
placeholder?stringPlaceholder text if nothing is selected or default; max 150 characters
min_values?integerMinimum number of items that must be chosen (defaults to 1); min 0, max 25
max_values?integerMaximum number of items that can be chosen (defaults to 1); max 25
required?*booleanWhether the string select is required to answer in a modal (defaults to true)
disabled?**booleanWhether 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
FieldTypeDescription
labelstringUser-facing name of the option; max 100 characters
valuestringDev-defined value of the option; max 100 characters
description?stringAdditional description of the option; max 100 characters
emoji?partial emoji objectid, name, and animated
default?booleanWill show this option as selected by default
String Select Interaction Response Structure
FieldTypeDescription
type*integer3 for a String Select
component_type*integer3 for a String Select
idintegerUnique identifier for the component
custom_idstringDeveloper-defined identifier for the input; max 100 characters
valuesarray of stringsThe text of the selected options
* In message interaction responses component_type will be returned and in modal interaction responses type will be returned.
Examples
Example of a String Select with three options
{
  "flags": 32768,
  "components": [
    {
      "type": 1, // ComponentType.ACTION_ROW,
      "id": 1,
      "components": [
        {
          "type": 3, // ComponentType.STRING_SELECT
          "id": 2,
          "custom_id": "favorite_bug",
          "placeholder": "Favorite bug?",
          "options": [
            {
              "label": "Ant",
              "value": "ant",
              "description": "(best option)",
              "emoji": {"name": "🐜"}
            },
            {
              "label": "Butterfly",
              "value": "butterfly",
              "emoji": {"name": "🦋"}
            },
            {
              "label": "Caterpillar",
              "value": "caterpillar",
              "emoji": {"name": "🐛"}
            }
          ]
        }
      ]
    }
  ]
}
When a user interacts with a StringSelect in a message, this is the basic form of the interaction data payload you will receive. The full payload is available in the interaction reference.
{
  "type": 3, // InteractionType.MESSAGE_COMPONENT
  ...additionalInteractionFields, // See the Interaction documentation for all fields

  "data": {
    "component_type": 3, // ComponentType.STRING_SELECT
    "custom_id": "favorite_bug",
    "values": [
      "butterfly",
    ]
  },
}

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
FieldTypeDescription
typeinteger4 for a text input
id?integerOptional identifier for component
custom_idstringDeveloper-defined identifier for the input; max 100 characters
styleintegerThe Text Input Style
min_length?integerMinimum input length for a text input; min 0, max 4000
max_length?integerMaximum input length for a text input; min 1, max 4000
required?booleanWhether this component is required to be filled (defaults to true)
value?stringPre-filled value for this component; max 4000 characters
placeholder?stringCustom 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
NameValueDescription
Short1Single-line input
Paragraph2Multi-line input
Text Input Interaction Response Structure
FieldTypeDescription
typeinteger4 for a Text Input
idintegerUnique identifier for the component
custom_idstringDeveloper-defined identifier for the input; max 100 characters
valuestringThe 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
FieldTypeDescription
typeinteger5 for user select
id?integerOptional identifier for component
custom_idstringID for the select menu; max 100 characters
placeholder?stringPlaceholder text if nothing is selected; max 150 characters
default_values?array of default value objectsList 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?integerMinimum number of items that must be chosen (defaults to 1); min 0, max 25
max_values?integerMaximum number of items that can be chosen (defaults to 1); max 25
required?*booleanWhether the user select is required to answer in a modal (defaults to true)
disabled?**booleanWhether 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
FieldTypeDescription
idsnowflakeID of a user, role, or channel
typestringType of value that id represents. Either "user", "role", or "channel"
User Select Interaction Response Structure
FieldTypeDescription
type*integer5 for a User Select
component_type*integer5 for a User Select
idintegerUnique identifier for the component
custom_idstringDeveloper-defined identifier for the input; max 100 characters
resolvedresolved dataResolved entities from selected options
valuesarray of snowflakesIDs of the selected users
* In message interaction responses component_type will be returned and in modal interaction responses type will be returned.
Examples
Example of a User Select with two people and an app in a server
{
  "flags": 32768,
  "components": [
    {
      "type": 1,  // ComponentType.ACTION_ROW
      "components": [
        {
          "type": 5,  // ComponentType.USER_SELECT
          "custom_id": "user_select",
          "placeholder": "Select a user"
        }
      ]
    }
  ]
}
When a user interacts with a User Select in a message, this is the basic form of the interaction data payload you will receive. The full payload is available in the interaction reference.
members and users may both be present in the resolved object when a user is selected.
{
  "type": 3, // InteractionType.MESSAGE_COMPONENT
  ...additionalInteractionFields, // See the Interaction documentation for all fields

  "data": {
    "component_type": 5, // ComponentType.USER_SELECT
    "id": 2,
    "custom_id": "user_select",
    "values": [
      "1111111111111111111",
    ],
    "resolved": {
      "members": {
        "1111111111111111111": {
          "avatar": null,
          "banner": null,
          "collectibles": null,
          "communication_disabled_until": null,
          "flags": 0,
          "joined_at": "2025-05-16T22:51:16.692000+00:00",
          "nick": null,
          "pending": false,
          "permissions": "2248473465835073",
          "premium_since": null,
          "roles": [
            "2222222222222222222"
          ],
          "unusual_dm_activity_until": null
        }
      },
      "users": {
        "1111111111111111111": {
          "avatar": "d54e87d20539fe9aad2f2cebe56809a2",
          "avatar_decoration_data": null,
          "bot": true,
          "clan": null,
          "collectibles": null,
          "discriminator": "9062",
          "display_name_styles": null,
          "global_name": null,
          "id": "1111111111111111111",
          "primary_guild": null,
          "public_flags": 524289,
          "username": "ExampleBot"
        }
      }
    }
  },
}

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
FieldTypeDescription
typeinteger6 for role select
id?integerOptional identifier for component
custom_idstringID for the select menu; max 100 characters
placeholder?stringPlaceholder text if nothing is selected; max 150 characters
default_values?array of default value objectsList 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?integerMinimum number of items that must be chosen (defaults to 1); min 0, max 25
max_values?integerMaximum number of items that can be chosen (defaults to 1); max 25
required?*booleanWhether the role select is required to answer in a modal (defaults to true)
disabled?**booleanWhether 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
FieldTypeDescription
type*integer6 for a Role Select
component_type*integer6 for a Role Select
idintegerUnique identifier for the component
custom_idstringDeveloper-defined identifier for the input; max 100 characters
resolvedresolved dataResolved entities from selected options
valuesarray of snowflakesIDs of the selected roles
* In message interaction responses component_type will be returned and in modal interaction responses type will be returned.
Examples
Example of a Role Select allowing up to 3 choices
{
  "flags": 32768,
  "components": [
    {
      "type": 1,  // ComponentType.ACTION_ROW
      "components": [
        {
          "type": 6,  // ComponentType.ROLE_SELECT
          "custom_id": "role_ids",
          "placeholder": "Which roles?",
          "min_values": 1,
          "max_values": 3
        }
      ]
    }
  ]
}
When a user interacts with a Role Select in a message, this is the basic form of the interaction data payload you will receive. The full payload is available in the interaction reference.
{
  "type": 3, // InteractionType.MESSAGE_COMPONENT
  ...additionalInteractionFields, // See the Interaction documentation for all fields

  "data": {
    "component_type": 6, // ComponentType.ROLE_SELECT
    "id": 2,
    "custom_id": "role_ids",
    "values": [
      "222222222222222222",
    ],
    "resolved": {
      "roles": {
        "222222222222222222": {
          "color": 12745742,
          "colors": {
            "primary_color": 12745742,
            "secondary_color": null,
            "tertiary_color": null
          },
          "description": null,
          "flags": 0,
          "hoist": false,
          "icon": null,
          "id": "222222222222222222",
          "managed": false,
          "mentionable": true,
          "name": "Developer",
          "permissions": "0",
          "position": 2,
          "unicode_emoji": "🔧"
        }
      }
    }
  },
}

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
FieldTypeDescription
typeinteger7 for mentionable select
id?integerOptional identifier for component
custom_idstringID for the select menu; max 100 characters
placeholder?stringPlaceholder text if nothing is selected; max 150 characters
default_values?array of default value objectsList 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?integerMinimum number of items that must be chosen (defaults to 1); min 0, max 25
max_values?integerMaximum number of items that can be chosen (defaults to 1); max 25
required?*booleanWhether the mentionable select is required to answer in a modal (defaults to true)
disabled?**booleanWhether 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
FieldTypeDescription
type*integer7 for a Mentionable Select
component_type*integer7 for a Mentionable Select
idintegerUnique identifier for the component
custom_idstringDeveloper-defined identifier for the input; max 100 characters
resolvedresolved dataResolved entities from selected options
valuesarray of snowflakesIDs of the selected mentionables
* In message interaction responses component_type will be returned and in modal interaction responses type will be returned.
Examples
Example of a Mentionable Select
{
  "flags": 32768,
  "components": [
    {
      "type": 1,  // ComponentType.ACTION_ROW
      "components": [
        {
          "type": 7, // ComponentType.MENTIONABLE_SELECT
          "custom_id": "who_to_ping",
          "placeholder": "Who?",
        }
      ]
    }
  ]
}
When a user interacts with a Mentionable Select in a message, this is the basic form of the interaction data payload you will receive. The full payload is available in the interaction reference.
members and users may both be present in the resolved object when a user is selected.
{
  "type": 3, // InteractionType.MESSAGE_COMPONENT
  ...additionalInteractionFields, // See the Interaction documentation for all fields

  "data": {
    "component_type": 7, // ComponentType.MENTIONABLE_SELECT
    "id": 2,
    "custom_id": "who_to_ping",
    "values": [
      "111111111111111111",
      "222222222222222222",
    ],
    "resolved": {
      "members": {
        "1111111111111111111": {
          "avatar": null,
          "banner": null,
          "collectibles": null,
          "communication_disabled_until": null,
          "flags": 0,
          "joined_at": "2025-05-16T22:51:16.692000+00:00",
          "nick": null,
          "pending": false,
          "permissions": "2248473465835073",
          "premium_since": null,
          "roles": [
            "2222222222222222222"
          ],
          "unusual_dm_activity_until": null
        }
      },
      "users": {
        "1111111111111111111": {
          "avatar": "d54e87d20539fe9aad2f2cebe56809a2",
          "avatar_decoration_data": null,
          "bot": true,
          "clan": null,
          "collectibles": null,
          "discriminator": "9062",
          "display_name_styles": null,
          "global_name": null,
          "id": "1111111111111111111",
          "primary_guild": null,
          "public_flags": 524289,
          "username": "ExampleBot"
        }
      },
      "roles": {
        "222222222222222222": {
          "color": 12745742,
          "colors": {
            "primary_color": 12745742,
            "secondary_color": null,
            "tertiary_color": null
          },
          "description": null,
          "flags": 0,
          "hoist": false,
          "icon": null,
          "id": "222222222222222222",
          "managed": false,
          "mentionable": true,
          "name": "Developer",
          "permissions": "0",
          "position": 2,
          "unicode_emoji": "🔧"
        }
      }
    }
  },
}

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
FieldTypeDescription
typeinteger8 for channel select
id?integerOptional identifier for component
custom_idstringID for the select menu; max 100 characters
channel_types?array of channel typesList of channel types to include in the channel select component
placeholder?stringPlaceholder text if nothing is selected; max 150 characters
default_values?array of default value objectsList 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?integerMinimum number of items that must be chosen (defaults to 1); min 0, max 25
max_values?integerMaximum number of items that can be chosen (defaults to 1); max 25
required?*booleanWhether the channel select is required to answer in a modal (defaults to true)
disabled?**booleanWhether 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
FieldTypeDescription
type*integer8 for a Channel Select
component_type*integer8 for a Channel Select
idintegerUnique identifier for the component
custom_idstringDeveloper-defined identifier for the input; max 100 characters
resolvedresolved dataResolved entities from selected options
valuesarray of snowflakesIDs of the selected channels
* In message interaction responses component_type will be returned and in modal interaction responses type will be returned.
Examples
Example of a Channel Select for text channels
{
  "flags": 32768,
  "components": [
    {
      "type": 1,  // ComponentType.ACTION_ROW
      "components": [
        {
          "type": 8,  // ComponentType.CHANNEL_SELECT
          "custom_id": "notification_channel",
          "channel_types": [0],  // ChannelType.TEXT
          "placeholder": "Which text channel?"
        }
      ]
    }
  ]
}
When a user interacts with a Channel Select in a message, this is the basic form of the interaction data payload you will receive. The full payload is available in the interaction reference.
{
  "type": 3, // InteractionType.MESSAGE_COMPONENT
  ...additionalInteractionFields, // See the Interaction documentation for all fields

  "data": {
    "component_type": 8, // ComponentType.CHANNEL_SELECT
    "id": 2,
    "custom_id": "notification_channel",
    "values": [
      "333333333333333333",
    ],
    "resolved": {
      "channels": {
        "333333333333333333": {
          "flags": 0,
          "guild_id": "44444444444444444",
          "id": "333333333333333333",
          "last_message_id": null,
          "name": "playtesting",
          "nsfw": false,
          "parent_id": "5555555555555555",
          "permissions": "4503599627370495",
          "position": 1,
          "rate_limit_per_user": 0,
          "topic": null,
          "type": 0  // ChannelType.TEXT
        }
      }
    }
  },
}

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
FieldTypeDescription
typeinteger9 for section component
id?integerOptional identifier for component
componentsarray of section child componentsOne to three child components representing the content of the section that is contextually associated to the accessory
accessorysection accessory componentA 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
Example of a Section showing a fake game changelog and a thumbnail
{
  "flags": 32768,
  "components": [
    {
      "type": 9,  // ComponentType.SECTION
      "components": [
        {
          "type": 10,  // ComponentType.TEXT_DISPLAY
          "content": "# Real Game v7.3"
        },
        {
          "type": 10,  // ComponentType.TEXT_DISPLAY
          "content": "Hope you're excited, the update is finally here! Here are some of the changes:\n- Fixed a bug where certain treasure chests wouldn't open properly\n- Improved server stability during peak hours\n- Added a new type of gravity that will randomly apply when the moon is visible in-game\n- Every third thursday the furniture will scream your darkest secrets to nearby npcs"
        },
        {
          "type": 10,  // ComponentType.TEXT_DISPLAY
          "content": "-# That last one wasn't real, but don't use voice chat near furniture just in case..."
        }
      ],
      "accessory": {
        "type": 11,  // ComponentType.THUMBNAIL
        "media": {
          "url": "https://websitewithopensourceimages/gamepreview.webp"
        }
      }
    }
  ]
}

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
FieldTypeDescription
typeinteger10 for text display
id?integerOptional identifier for component
contentstringText that will be displayed similar to a message
Text Display Interaction Response Structure
FieldTypeDescription
typeinteger10 for a Text Display
idintegerUnique identifier for the component
Examples
Example of a Text Display with markdown
{
  "flags": 32768,
  "components": [
    {
      "type": 10,  // ComponentType.TEXT_DISPLAY
      "content": "# This is a Text Display\nAll the regular markdown rules apply\n- You can make lists\n- You can use `code blocks`\n- You can use [links](http://watchanimeattheoffice.com/)\n- Even :blush: :star_struck: :exploding_head:\n- Spoiler alert: ||these too!||"
    }
  ]
}

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
FieldTypeDescription
typeinteger11 for thumbnail component
id?integerOptional identifier for component
mediaunfurled media itemA url or attachment provided as an unfurled media item
description?stringAlt text for the media, max 1024 characters
spoiler?booleanWhether the thumbnail should be a spoiler (or blurred out). Defaults to false
Examples
Example of a Section showing a fake game changelog and a thumbnail
{
  "flags": 32768,
  "components": [
    {
      "type": 9,  // ComponentType.SECTION
      "components": [
        {
          "type": 10,  // ComponentType.TEXT_DISPLAY
          "content": "# Real Game v7.3"
        },
        {
          "type": 10,  // ComponentType.TEXT_DISPLAY
          "content": "Hope you're excited, the update is finally here! Here are some of the changes:\n- Fixed a bug where certain treasure chests wouldn't open properly\n- Improved server stability during peak hours\n- Added a new type of gravity that will randomly apply when the moon is visible in-game\n- Every third thursday the furniture will scream your darkest secrets to nearby npcs"
        },
        {
          "type": 10,  // ComponentType.TEXT_DISPLAY
          "content": "-# That last one wasn't real, but don't use voice chat near furniture just in case..."
        }
      ],
      "accessory": {
        "type": 11,  // ComponentType.THUMBNAIL
        "media": {
          "url": "https://websitewithopensourceimages/gamepreview.webp"
        }
      }
    }
  ]
}

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
FieldTypeDescription
typeinteger12 for media gallery component
id?integerOptional identifier for component
itemsarray of media gallery items1 to 10 media gallery items
Media Gallery Item Structure
FieldTypeDescription
mediaunfurled media itemA url or attachment provided as an unfurled media item
description?stringAlt text for the media, max 1024 characters
spoiler?booleanWhether the media should be a spoiler (or blurred out). Defaults to false
Examples
Example of a Media Gallery showing screenshots from live webcam feeds
{
  "flags": 32768,
  "components": [
    {
      "type": 10,  // ComponentType.TEXT_DISPLAY
      "content": "Live webcam shots as of 18-04-2025 at 12:00 UTC"
    },
    {
      "type": 12,  // ComponentType.MEDIA_GALLERY
      "items": [
        {
          "media": {"url": "https://livevideofeedconvertedtoimage/webcam1.webp"},
          "description": "An aerial view looking down on older industrial complex buildings. The main building is white with many windows and pipes running up the walls."
        },
        {
          "media": {"url": "https://livevideofeedconvertedtoimage/webcam2.webp"},
          "description": "An aerial view of old broken buildings. Nature has begun to take root in the rooftops. A portion of the middle building's roof has collapsed inward. In the distant haze you can make out a far away city."
        },
        {
          "media": {"url": "https://livevideofeedconvertedtoimage/webcam3.webp"},
          "description": "A street view of a downtown city. Prominently in photo are skyscrapers and a domed building"
        }
      ]
    }
  ]
}

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.
The File component only supports using the attachment:// protocol in unfurled media item
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
FieldTypeDescription
typeinteger13 for a file component
id?integerOptional identifier for component
fileunfurled media itemThis unfurled media item is unique in that it only supports attachment references using the attachment://<filename> syntax
spoiler?booleanWhether the media should be a spoiler (or blurred out). Defaults to false
namestringThe name of the file. This field is ignored and provided by the API as part of the response
sizeintegerThe size of the file in bytes. This field is ignored and provided by the API as part of the response
Examples
Example of a File showing a download for a game and manual
This example makes use of the attachment:// protocol functionality in unfurled media item.
{
  "flags": 32768,
  "components": [
    {
      "type": 10,  // ComponentType.TEXT_DISPLAY
      "content": "# New game version released for testing!\nGrab the game here:"
    },
    {
      "type": 13,  // ComponentType.FILE
      "file": {
        "url": "attachment://game.zip"
      }
    },
    {
      "type": 10,  // ComponentType.TEXT_DISPLAY
      "content": "Latest manual artwork here:"
    },
    {
      "type": 13,  // ComponentType.FILE
      "file": {
        "url": "attachment://manual.pdf"
      }
    }
  ]
}

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
FieldTypeDescription
typeinteger14 for separator component
id?integerOptional identifier for component
divider?booleanWhether a visual divider should be displayed in the component. Defaults to true
spacing?integerSize of separator padding—1 for small padding, 2 for large padding. Defaults to 1
Examples
Example of a separator with large spacing dividing content
{
  "flags": 32768,
  "components": [
    {
      "type": 10,  // ComponentType.TEXT_DISPLAY
      "content": "It's dangerous to go alone!"
    },
    {
      "type": 14,  // ComponentType.SEPARATOR
      "divider": true,
      "spacing": 1
    },
    {
      "type": 10,  // ComponentType.TEXT_DISPLAY
      "content": "Take this."
    }
  ]
}

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
FieldTypeDescription
typeinteger17 for container component
id?integerOptional identifier for component
componentsarray of container child componentsChild components that are encapsulated within the Container
accent_color??integerColor for the accent on the container as RGB from 0x000000 to 0xFFFFFF
spoiler?booleanWhether the container should be a spoiler (or blurred out). Defaults to false.
Container Child Components
Examples
Example of a container showing text, image, and buttons for a wild enemy encounter
{
  "flags": 32768,
  "components": [
    {
      "type": 17,  // ComponentType.CONTAINER
      "accent_color": 703487,
      "components": [
        {
          "type": 10,  // ComponentType.TEXT_DISPLAY
          "content": "# You have encountered a wild coyote!"
        },
        {
          "type": 12,  // ComponentType.MEDIA_GALLERY
          "items": [
            {
              "media": {"url": "https://websitewithopensourceimages/coyote.webp"},
            }
          ]
        },
        {
          "type": 10,  // ComponentType.TEXT_DISPLAY
          "content": "What would you like to do?"
        },
        {
          "type": 1,  // ComponentType.ACTION_ROW
          "components": [
            {
              "type": 2,  // ComponentType.BUTTON
              "custom_id": "pet_coyote",
              "label": "Pet it!",
              "style": 1
            },
            {
              "type": 2,  // ComponentType.BUTTON
              "custom_id": "feed_coyote",
              "label": "Attempt to feed it",
              "style": 2
            },
            {
              "type": 2,  // ComponentType.BUTTON
              "custom_id": "run_away",
              "label": "Run away!",
              "style": 4
            }
          ]
        }
      ]
    }
  ]
}

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
FieldTypeDescription
typeinteger18 for a label
id?integerOptional identifier for component
labelstringThe label text; max 45 characters
description?stringAn optional description text for the label; max 100 characters
componentlabel child componentThe component within the label
Label Child Components
Label Interaction Response Structure
FieldTypeDescription
typeinteger18 for a Label
idintegerUnique identifier for the component
componentlabel interaction response child componentThe component within the label
Label Interaction Response Child Components
Examples

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.
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
FieldTypeDescription
urlstringSupports arbitrary urls and attachment://<filename> references
proxy_url?stringThe proxied url of the media item. This field is ignored and provided by the API as part of the response
height??integerThe height of the media item. This field is ignored and provided by the API as part of the response
width??integerThe width of the media item. This field is ignored and provided by the API as part of the response
content_type?stringThe media type of the content. This field is ignored and provided by the API as part of the response
attachment_id?*snowflakeThe 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"
        }
      ]
    }
  ]
}