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.

Anatomy of a Component

All components have the following fields: 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.

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
Action Row Child Components
Examples
Example of an Action Row with three buttons

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
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
Examples
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.

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
* min_values must be either omitted or at least 1 if required is omitted or true. ** 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
String Select Interaction Response Structure
* 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
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.

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
The label field on a Text Input is deprecated in favor of label and description on the Label component.
Text Input Styles
Text Input Interaction Response Structure
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
* min_values must be either omitted or at least 1 if required is omitted or true. ** 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
User Select Interaction Response Structure
* 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
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.

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
* min_values must be either omitted or at least 1 if required is omitted or true. ** 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
* 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
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.

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
* min_values must be either omitted or at least 1 if required is omitted or true. ** 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
* In message interaction responses component_type will be returned and in modal interaction responses type will be returned.
Examples
Example of a Mentionable Select from the code below
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.

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
* min_values must be either omitted or at least 1 if required is omitted or true. ** 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
* 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
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.

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
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
Section Accessory Components
Examples
Example of a Section showing a fake game changelog and a thumbnail

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
Text Display Interaction Response Structure
Examples
Example of a Text Display with markdown

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
Examples
Example of a Thumbnail in a Section from the code below

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
Media Gallery Item Structure
Examples
Example of a Media Gallery showing screenshots from live webcam feeds

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
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.

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
Examples
Example of a separator with large spacing dividing content

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
Container Child Components
Examples
Example of a container showing text, image, and buttons for a wild enemy encounter

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
Label Child Components
Label Interaction Response Structure
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
* min_values must be either omitted or at least 1 if required is omitted or true.
File Upload Interaction Response Structure
Examples

Radio Group

A Radio Group is an interactive component for selecting exactly one option from a defined list. Radio Groups are available in modals and must be placed inside a Label.

Radio Group Structure

Radio Group Option Structure

Radio Group Interaction Response Structure

Examples


Checkbox Group

A Checkbox Group is an interactive component for selecting one or many options via checkboxes. Checkbox Groups are available in modals and must be placed inside a Label.

Checkbox Group Structure

* min_values must be either omitted or at least 1 if required is omitted or true.

Checkbox Group Option Structure

Checkbox Group Interaction Response Structure

Examples


Checkbox

A Checkbox is a single interactive component for simple yes/no style questions. Checkboxes are available in modals and must be placed inside a Label.

Checkbox Structure

While you can’t set a checkbox as required, you can use a Checkbox Group with a single option and required to achieve similar functionality.

Checkbox Interaction Response Structure

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
* 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.
Unfurled Media Item Flags

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