Component types
Every component, with its type number, category and where it can be used.
type |
Name | Category | Messages | Modals | Interactive |
|---|---|---|---|---|---|
1 |
Action Row | Layout | ✅ | ⚠️ deprecated | — |
2 |
Button | Interactive | ✅ | — | ✅ |
3 |
String Select | Interactive | ✅ | ✅ | ✅ |
4 |
Text Input | Interactive | — | ✅ | ✅ |
5 |
User Select | Interactive | ✅ | ✅ | ✅ |
6 |
Role Select | Interactive | ✅ | ✅ | ✅ |
7 |
Mentionable Select | Interactive | ✅ | ✅ | ✅ |
8 |
Channel Select | Interactive | ✅ | ✅ | ✅ |
9 |
Section | Layout | ✅ | — | — |
10 |
Text Display | Content | ✅ | ✅ | — |
11 |
Thumbnail | Content | ✅ | — | — |
12 |
Media Gallery | Content | ✅ | — | — |
13 |
File | Content | ✅ | — | — |
14 |
Separator | Layout | ✅ | — | — |
17 |
Container | Layout | ✅ | — | — |
18 |
Label | Layout | — | ✅ | — |
19 |
File Upload | Interactive | — | ✅ | ✅ |
21 |
Radio Group | Interactive | — | ✅ | ✅ |
22 |
Checkbox Group | Interactive | — | ✅ | ✅ |
23 |
Checkbox | Interactive | — | ✅ | ✅ |
What can go inside what?
Section titled “What can go inside what?”| Parent | Allowed children |
|---|---|
| Message (top level) | Action Row, Text Display, Section, Media Gallery, Separator, File, Container |
| Container | Action Row, Text Display, Section, Media Gallery, Separator, File |
Section → components |
1-3 Text Display |
Section → accessory |
1 Button or 1 Thumbnail |
| Action Row | 1-5 Button, or 1 select (String, User, Role, Mentionable, Channel) |
| Modal (top level) | Label, Text Display |
Label → component |
Text Input, any select, File Upload, Radio Group, Checkbox Group or Checkbox |
Common fields
Section titled “Common fields”| Field | Type | Description |
|---|---|---|
type |
integer | required The type from the table above. |
id |
integer | optional Unique identifier in the message (32-bit). Generated if omitted. |
custom_id |
string | Interactive only. 1-100 characters, unique in the message. |
Button styles
Section titled “Button styles”| Name | Value |
|---|---|
| Primary | 1 |
| Secondary | 2 |
| Success | 3 |
| Danger | 4 |
| Link | 5 |
| Premium | 6 |
Text Input styles
Section titled “Text Input styles”| Name | Value |
|---|---|
| Short (single line) | 1 |
| Paragraph | 2 |
Separator spacing
Section titled “Separator spacing”| Name | Value |
|---|---|
| Small | 1 |
| Large | 2 |