Skip to content

Label

type: 18 Modals

The Label wraps one input component in a modal and adds a title and a description. It’s the recommended way to build modals.

Preview
Sign up
Username*
This is how others will see you in the tournament.
e.g. SuperGamer
Your team*
Pick your team's role
modal.json
{
"type": 9,
"data": {
"custom_id": "signup",
"title": "Sign up",
"components": [
{
"type": 18,
"label": "Username",
"description": "This is how others will see you in the tournament.",
"component": {
"type": 4,
"custom_id": "username",
"style": 1,
"placeholder": "e.g. SuperGamer",
"max_length": 32
}
},
{
"type": 18,
"label": "Your team",
"component": {
"type": 6,
"custom_id": "team",
"placeholder": "Pick your team's role"
}
}
]
}
}
Field Type Description
type integer required Always 18.
id integer optional Unique identifier.
label string required Title. Max 45 characters.
description string optional Help text. Max 100 characters. May be shown above or below the component.
component component required The input component (see below).

Respond to the interaction with the JSON above (response type 9).