Discord Button & Component Builder
Design buttons and select menus for a Discord message, checked against Discord's component limits as you go. Preview it in a Discord-style message and copy JSON, discord.js or discord.py.
Message
Classic component messages can carry text and embeds alongside the buttons.
Rows
Default 1. 0 lets people choose nothing.
Default 1. Above 1 makes it multi-select.
Copy it
[
{
"type": 1,
"components": [
{
"type": 2,
"style": 1,
"label": "Open a ticket",
"emoji": {
"name": "🎫"
},
"custom_id": "ticket_open"
},
{
"type": 2,
"style": 2,
"label": "FAQ",
"custom_id": "faq"
},
{
"type": 2,
"style": 5,
"label": "Status page",
"url": "https://status.example.com"
}
]
},
{
"type": 1,
"components": [
{
"type": 3,
"custom_id": "choose_topic",
"placeholder": "Choose a topic",
"options": [
{
"label": "Billing",
"value": "billing",
"description": "Invoices and payments"
},
{
"label": "Technical help",
"value": "tech"
}
]
}
]
}
]POST the message payload to /channels/{channel_id}/messages with a bot token, or to a webhook URL with ?with_components=true (link buttons only for channel webhooks).
Built on this page. Nothing is sent to Discord or to us; you post it with your own bot or webhook.
How Discord components fit together
Buttons and menus never sit loose in a message. They live inside action rows, and a message using classic components can have up to five rows. Each row holds either up to five buttons or a single select menu, never both. That is why the builder works row by row: pick what a row is for, then fill it.
- Buttons come in five styles here: primary (blurple), secondary (grey), success (green), danger (red) and link. Labels can be 80 characters, though a short verb reads best.
- custom_id is how your bot tells clicks apart, 1 to 100 characters, unique within the message. Link buttons take a URL of up to 512 characters instead.
- String select menus offer up to 25 options, each with a label, value and optional description of up to 100 characters, and a placeholder of up to 150.
Discord has a newer layout system for messages (components V2) with sections, text and containers. This builder covers classic buttons and selects, which still work alongside message text and embeds and which Discord says it will keep supporting.
Someone has to answer the click
The most common surprise with buttons is that they do nothing on their own. Clicking a primary, secondary, success or danger button, or choosing from a menu, sends an interaction to the application that posted the message. Your bot must send an initial response within three seconds; after that Discord invalidates the token, and the member sees the click fail. The discord.js and discord.py code includes a minimal handler for exactly this.
Link buttons are the exception: they open the URL in the member's browser and send nothing to your app. That is also why a plain channel webhook, which has no application behind it to receive clicks, can only send link buttons, and only when the request includes with_components=true. An application-owned webhook or a bot can send everything. If your bot posts but never reacts, read why a Discord bot stops responding.
Designing buttons members actually use
- One primary per row. The main action should stand out; three blurple buttons side by side is no emphasis at all.
- Danger means danger. Keep red for deleting or leaving, and confirm before acting on it.
- Verbs on labels. “Open a ticket” says what happens; “Tickets” does not.
- Menus for long lists. More than four or five choices read better as a select menu than as a wall of buttons, especially on phones.
- Disable instead of hiding. When an action is not available yet, a disabled button tells people it exists.
- Pack state into custom_id carefully.
ticket_close:4821is handy, but it is visible to any client, so never put secrets in it.
From buttons to a working support bot
Buttons shine as the front door of a help desk: a row of topics, a menu of products, a link to the status page. Add rich detail to the same message with the Discord embed builder, give members typed commands with the slash command builder, and look up any 4xx response in the Discord error code reference. In chat products generally these choices are called quick replies. Conferbot builds a Discord chatbot without code, on a free plan, that answers members from your own content.
Frequently asked questions
How many buttons can a Discord message have?
A message using classic components can have up to five action rows, and each row holds up to five buttons or exactly one select menu. That makes 25 buttons at most, or fewer if some rows are selects. Every button that is not a link needs its own custom_id, and no two components in a message may share one.
Why does nothing happen when I click my button?
Primary, secondary, success and danger buttons send an interaction to the application that posted the message, and something has to answer it. Discord requires an initial response within three seconds of the click. If no bot is listening, or it answers late, the click fails. Link buttons are different: they open the URL and send nothing to your app.
Can a Discord webhook send buttons?
A webhook created in a channel's settings can send link buttons, which need no one to answer them, but only when the request adds the with_components=true query parameter; otherwise the components are ignored. Interactive buttons and select menus need an application-owned webhook or a bot, because the clicks have to reach an application.
What is a custom_id in a Discord button?
It is a string of 1 to 100 characters that your bot receives when someone clicks the button or picks from a select menu, so you know which control was used. Many bots pack a little state into it, such as an action and an item ID. It must be unique within the message. Link buttons have a URL instead.
What are the limits for a Discord select menu?
A string select takes one whole action row. It can have up to 25 options, each with a label, value and description of up to 100 characters, and a placeholder of up to 150 characters. min_values can be 0 to 25 and max_values 1 to 25; both default to 1, which makes a single-choice menu.
Which button style should I use?
Use primary for the one action you most want, secondary for the alternatives, success to confirm something positive, and danger for anything destructive or irreversible, like deleting. Link opens a website. Keep one primary button per row so the main action stands out, and put the safe choice where an accidental tap does no harm.
Related
Let a bot answer the clicks
Build a Discord chatbot that answers members from your own content and hands tricky questions to your team. No code, free plan.