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, Labels, and Separators.

Content Components

For displaying static text, images, and files — Text Display, Media Gallery, Thumbnails, and File.

Interactive Components

For user interactions — Buttons, Select Menus, Text Input, File Upload, Radio Group, and Checkboxes.
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 — 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 provides less flexibility and control over message layout.
For a practical guide on implementing these components, see Using Message Components and Using Modal Components.

What is a Component

Components allow you to style and structure your messages, modals, and interactions. They are interactive elements that can create rich user experiences in your Discord applications. Components are a field on the message object and modal. You can use them when creating messages or responding to an interaction, like an application command.

Component Types

The following is a complete table of available components.
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
19File UploadComponent for uploading filesInteractiveModal
21Radio GroupSingle-choice set of optionsInteractiveModal
22Checkbox GroupMulti-selectable group of checkboxesInteractiveModal
23CheckboxSingle checkbox for yes/no choiceInteractiveModal

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 the 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.
FieldTypeDescription
custom_idstringDeveloper-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
FieldTypeDescription
typeinteger1 for action row component
id?integerOptional identifier for component
componentsarrayUp to 5 Button components or a single select component
Child Components
ComponentDescription
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
{
  "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; 1–100 characters
sku_id?snowflakeIdentifier for a purchasable SKU; only available for premium-style buttons
url?stringURL for link-style buttons; max 512 characters
disabled?booleanWhether the button is disabled (defaults to false)
  • Non-link and non-premium buttons must have a custom_id, and cannot have a url or sku_id
  • Link buttons must have a url, and cannot have a custom_id — they do not send an interaction when clicked
  • Premium buttons must have a sku_id, and cannot have a custom_id, label, url, or emoji — they do not send an interaction when clicked
Button Styles
NameValueActionRequired Field
Primary1The most important or recommended action in a groupcustom_id
Secondary2Alternative or supporting actionscustom_id
Success3Positive confirmation or completion actionscustom_id
Danger4An action with irreversible consequencescustom_id
Link5Navigates to a URLurl
Premium6Purchasesku_id
{
  "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, this is the basic form of the interaction data payload you will receive.
{
  "type": 3,  // InteractionType.MESSAGE_COMPONENT
  // ...additionalInteractionFields

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

Button Design Guidelines

  • Max 34 characters with icon or emoji; max 38 characters without
  • Keep text concise — use verbs that indicate the outcome of the action
  • Use clear, easily understandable language; avoid jargon
  • Maintain consistency in language and tone across buttons
  • Test button text for expansion or contraction in translated languages
Multiple Buttons: Use different button styles to create a hierarchy. Use only one Primary button per group. If multiple buttons are of equal significance, use Secondary for all. Premium Buttons automatically display the shop icon, SKU name, and SKU price — no additional configuration needed.

String Select

A String Select is an interactive component that allows users to select one or more provided options. It supports 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; 1–100 characters
optionsarraySpecified choices in a select menu; max 25
placeholder?stringPlaceholder text if nothing is selected; 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 in a modal (defaults to true)
disabled?***booleanWhether select menu is disabled in a message (defaults to false)
* min_values must be 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.
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 emojiid, name, and animated
default?booleanWill show this option as selected by default
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; 1–100 characters
valuesarray of stringsThe text of the selected options
* In message responses component_type is returned; in modal responses type is returned.
{
  "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": "🐛"} }
          ]
        }
      ]
    }
  ]
}
{
  "type": 3,  // InteractionType.MESSAGE_COMPONENT
  // ...additionalInteractionFields

  "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. All Text Inputs should be placed inside a Label component going forward.
Text Input Structure
FieldTypeDescription
typeinteger4 for a text input
id?integerOptional identifier for component
custom_idstringDeveloper-defined identifier for the input; 1–100 characters
styleintegerThe Text Input Style
min_length?integerMinimum input length; min 0, max 4000
max_length?integerMaximum input length; 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
Interaction Response Structure
FieldTypeDescription
typeinteger4 for a Text Input
idintegerUnique identifier for the component
custom_idstringDeveloper-defined identifier; 1–100 characters
valuestringThe user’s input text

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 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; 1–100 characters
placeholder?stringPlaceholder text if nothing is selected; max 150 characters
default_values?arrayList of default values; count must be within min_values/max_values range
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 in a modal (defaults to true)
disabled?***booleanWhether select menu is disabled in a message (defaults to false)
Select Default Value Structure
FieldTypeDescription
idsnowflakeID of a user, role, or channel
typestringType of value — "user", "role", or "channel"
{
  "flags": 32768,
  "components": [
    {
      "type": 1,  // ComponentType.ACTION_ROW
      "components": [
        {
          "type": 5,  // ComponentType.USER_SELECT
          "custom_id": "user_select",
          "placeholder": "Select a user"
        }
      ]
    }
  ]
}

Role Select

A Role Select is an interactive component that allows users to select one or more roles. Options are automatically populated based on the server’s available roles. Role Selects 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; 1–100 characters
placeholder?stringPlaceholder text if nothing is selected; max 150 characters
default_values?arrayList of default 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 in a modal (defaults to true)
disabled?***booleanWhether select menu is disabled in a message (defaults to false)
{
  "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
        }
      ]
    }
  ]
}

Mentionable Select

A Mentionable Select is an interactive component that allows users to select one or more mentionables (users and roles) in a message or modal. Options are automatically populated based on available mentionables in the server. Mentionable Selects 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; 1–100 characters
placeholder?stringPlaceholder text if nothing is selected; max 150 characters
default_values?arrayList of default 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 in a modal (defaults to true)
disabled?***booleanWhether select menu is disabled in a message (defaults to false)
{
  "flags": 32768,
  "components": [
    {
      "type": 1,  // ComponentType.ACTION_ROW
      "components": [
        {
          "type": 7,  // ComponentType.MENTIONABLE_SELECT
          "custom_id": "who_to_ping",
          "placeholder": "Who?"
        }
      ]
    }
  ]
}

Channel Select

A Channel Select is an interactive component that allows users to select one or more channels. Options are automatically populated based on available channels in the server and can be filtered by channel type. Channel Selects 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; 1–100 characters
channel_types?arrayList of channel types to include in the select
placeholder?stringPlaceholder text if nothing is selected; max 150 characters
default_values?arrayList of default 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 in a modal (defaults to true)
disabled?***booleanWhether select menu is disabled in a message (defaults to false)
{
  "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?"
        }
      ]
    }
  ]
}

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 associate Text Display content with an accessory. Sections are currently only available in messages.
To use this component, you must send the message flag 1 << 15 (IS_COMPONENTS_V2).
Section Structure
FieldTypeDescription
typeinteger9 for section component
id?integerOptional identifier for component
componentsarray1–3 child components representing the content of the section
accessorycomponentA component contextually associated to the section content
Child Components: Text Display Accessory Components: Button, 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"
        }
      ],
      "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. Its behavior is similar to the content field of a message, but you can add multiple Text Display components to control the layout of your message. Pingable mentions in a Text Display will ping and send notifications based on the allowed mentions object in message.allowed_mentions.
To use this component in messages, you must send the message flag 1 << 15 (IS_COMPONENTS_V2).
Text Display Structure
FieldTypeDescription
typeinteger10 for text display
id?integerOptional identifier for component
contentstringText that will be displayed similar to a message
{
  "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, intended as an accessory to other content. It is primarily usable with Sections. Media is defined by the Unfurled Media Item structure, which supports both uploaded and external media. Thumbnails are only available in messages as an accessory within a Section. They support images including animated formats like GIF and WebP. Videos are not currently supported.
To use this component, you must send the message flag 1 << 15 (IS_COMPONENTS_V2).
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 blurred out (defaults to false)

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 only available in messages.
To use this component, you must send the message flag 1 << 15 (IS_COMPONENTS_V2).
Media Gallery Structure
FieldTypeDescription
typeinteger12 for media gallery component
id?integerOptional identifier for component
itemsarray1–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 blurred out (defaults to false)
{
  "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."
        },
        {
          "media": {"url": "https://livevideofeedconvertedtoimage/webcam2.webp"},
          "description": "An aerial view of old broken buildings with nature taking root on the rooftops."
        },
        {
          "media": {"url": "https://livevideofeedconvertedtoimage/webcam3.webp"},
          "description": "A street view of a downtown city with 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 a message. Each File component can only display 1 attached file, but you can upload multiple files and reference them from different File components within your payload. Files are only available in messages.
The File component only supports using the attachment:// protocol in Unfurled Media Item.
To use this component, you must send the message flag 1 << 15 (IS_COMPONENTS_V2).
File Structure
FieldTypeDescription
typeinteger13 for a file component
id?integerOptional identifier for component
fileunfurled media itemSupports only attachment://<filename> syntax
spoiler?booleanWhether the media should be blurred out (defaults to false)
name?stringName of the file — ignored in requests, provided by API in responses
size?integerSize of the file in bytes — ignored in requests, provided by API in responses
{
  "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 only available in messages.
To use this component, you must send the message flag 1 << 15 (IS_COMPONENTS_V2).
Separator Structure
FieldTypeDescription
typeinteger14 for separator component
id?integerOptional identifier for component
divider?booleanWhether a visual divider line should be displayed (defaults to true)
spacing?integerSize of separator padding — 1 for small, 2 for large (defaults to 1)
{
  "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 that visually encapsulates a collection of components with an optional customizable accent color bar. Containers are only available in messages.
To use this component, you must send the message flag 1 << 15 (IS_COMPONENTS_V2).
Container Structure
FieldTypeDescription
typeinteger17 for container component
id?integerOptional identifier for component
componentsarrayChild components encapsulated within the Container
accent_color?integerColor for the accent bar as RGB from 0x000000 to 0xFFFFFF
spoiler?booleanWhether the container should be blurred out (defaults to false)
Container Child Components: Action Row, Text Display, Section, Media Gallery, Separator, File
{
  "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, "custom_id": "pet_coyote", "label": "Pet it!", "style": 1 },
            { "type": 2, "custom_id": "feed_coyote", "label": "Attempt to feed it", "style": 2 },
            { "type": 2, "custom_id": "run_away", "label": "Run away!", "style": 4 }
          ]
        }
      ]
    }
  ]
}

Label

A Label is a top-level layout component for modals. It wraps interactive modal components with a text label and an 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; max 100 characters
componentcomponentThe component within the label
Label Child Components: Text Input, String Select, User Select, Role Select, Mentionable Select, Channel Select, File Upload, Radio Group, Checkbox Group, Checkbox

File Upload

File Upload is an interactive component that allows users to upload files in modals. It supports configuring minimum and maximum file counts (0–10) and a required flag for submission. The maximum file size a user can upload is based on their upload limit in that channel. File Uploads are only available in modals and must be placed inside a Label. File Upload Structure
FieldTypeDescription
typeinteger19 for file upload
id?integerOptional identifier for component
custom_idstringID for the file upload; 1–100 characters
min_values?*integerMinimum number of files that must be uploaded (defaults to 1); min 0, max 10
max_values?integerMaximum number of files that can be uploaded (defaults to 1); max 10
required?booleanWhether files are required before submitting the modal (defaults to true)
Interaction Response Structure
FieldTypeDescription
typeinteger19 for a File Upload
idintegerUnique identifier for the component
custom_idstringDeveloper-defined identifier; 1–100 characters
valuesarray of snowflakesIDs of the uploaded files in the resolved data

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
FieldTypeDescription
typeinteger21 for radio group
id?integerOptional identifier for component
custom_idstringDeveloper-defined identifier; 1–100 characters
optionsarrayList of options to show; min 2, max 10
required?booleanWhether a selection is required to submit the modal (defaults to true)
Radio Group Option Structure
FieldTypeDescription
valuestringDev-defined value of the option; max 100 characters
labelstringUser-facing label of the option; max 100 characters
description?stringOptional description for the option; max 100 characters
default?booleanShows the option as selected by default
Interaction Response Structure
FieldTypeDescription
typeinteger21 for a Radio Group
idintegerUnique identifier for the component
custom_idstringDeveloper-defined identifier; 1–100 characters
value?stringThe value of the selected option, or null if none selected

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
FieldTypeDescription
typeinteger22 for checkbox group
id?integerOptional identifier for component
custom_idstringDeveloper-defined identifier; 1–100 characters
optionsarrayList of options to show; min 1, max 10
min_values?*integerMinimum number of items that must be chosen; min 0, max 10 (defaults to 1)
max_values?integerMaximum number of items that can be chosen; min 1, max 10 (defaults to number of options)
required?booleanWhether selecting within the group is required (defaults to true)
Checkbox Group Option Structure
FieldTypeDescription
valuestringDev-defined value of the option; max 100 characters
labelstringUser-facing label of the option; max 100 characters
description?stringOptional description for the option; max 100 characters
default?booleanShows the option as selected by default
Interaction Response Structure
FieldTypeDescription
typeinteger22 for a Checkbox Group
idintegerUnique identifier for the component
custom_idstringDeveloper-defined identifier; 1–100 characters
valuesarray of stringsThe values of the selected options, or [] if none selected

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
FieldTypeDescription
typeinteger23 for checkbox
id?integerOptional identifier for component
custom_idstringDeveloper-defined identifier; 1–100 characters
default?booleanWhether the checkbox is selected by default
While you can’t set a Checkbox as required, you can use a Checkbox Group with a single option and required: true to achieve similar functionality.
Interaction Response Structure
FieldTypeDescription
typeinteger23 for a Checkbox
idintegerUnique identifier for the component
custom_idstringDeveloper-defined identifier; 1–100 characters
valuebooleanThe state of the checkbox (true if checked, false if unchecked)

Unfurled Media Item

An Unfurled Media Item is a piece of media, represented by a URL, used within a component. It can be constructed via uploading media to Discord or by referencing external media via a direct link to the asset.
Only the url field is settable by developers when making requests. All other fields are automatically populated by Discord.
Unfurled Media Item Structure
FieldTypeDescription
urlstringSupports arbitrary URLs and attachment://<filename> references
proxy_url?stringThe proxied URL — provided by the API in responses
height?integerThe height of the media item — provided by the API in responses
width?integerThe width of the media item — provided by the API in responses
content_type?stringThe media type of the content — provided by the API in responses
attachment_id?*snowflakeThe ID of the uploaded attachment — provided by the API in responses
* Only present if the media item was uploaded as an attachment.

Uploading a File

To upload a file with your message, send your payload as multipart/form-data (rather than application/json) and include your file with a valid filename. Details and examples can be found in the API Reference.

Legacy Message Component Behavior

Before the introduction of the IS_COMPONENTS_V2 flag, message components were sent in conjunction with message content. You could send a message using a subset of available components without setting the flag, and components would be included alongside content and embeds. Components in legacy messages will contain an id of 0. Apps using legacy behavior will continue to work as expected, but using the IS_COMPONENTS_V2 flag is recommended for new apps and features as it offers more options for layout and customization.
Legacy messages allow up to 5 action rows as top-level components.
{
  "content": "This is a message with legacy components",
  "components": [
    {
      "type": 1,
      "components": [
        {
          "type": 2,
          "style": 1,
          "label": "Click Me",
          "custom_id": "click_me_1"
        }
      ]
    }
  ]
}