Skip to main content

Keyboards & Buttons

Make your bot interactive with reply keyboards and inline buttons.


Types of Keyboards

Telegram supports two types of interactive keyboards:

Reply Keyboard

Buttons that replace the user's actual keyboard:

┌─────────────────────────────┐
│ 📊 Status │ ⚙️ Settings │
├─────────────┴───────────────┤
│ ❓ Help │
└─────────────────────────────┘
  • User taps a button → sends that button's text as a message
  • Great for menus and quick responses

Inline Keyboard

Buttons attached to a message:

Choose your plan:

[🌟 Basic - $9/mo] [💎 Pro - $19/mo]
[🚀 Enterprise - Contact Us]
  • User taps → triggers a callback (doesn't send a message)
  • Great for selections and actions

Creating Keyboards

Using the Keyboard Builder

  1. Add a Reply Markup node (or configure buttons in an action node)
  2. Click the keyboard builder icon
  3. Design your keyboard visually:
    • Add rows and buttons
    • Set button text
    • Configure actions (for inline buttons)

Button Layout

Buttons are arranged in rows:

Row 1: [Button A] [Button B] [Button C]
Row 2: [Button D] [Button E]
Row 3: [Wide Button Spanning Full Width]

Reply Keyboard Options

OptionWhat It Does
ResizeMake the keyboard smaller on screen
One TimeHide after one button is pressed
PlaceholderShow hint text in input field

Example: Main Menu

┌──────────────────────────────┐
│ 📊 My Stats │ 👤 Profile │
├──────────────┬───────────────┤
│ ⚙️ Settings │ ❓ Help │
└──────────────┴───────────────┘

When user taps "📊 My Stats", they send 📊 My Stats as a message.


Inline Button Types

Callback Button

Most common type — triggers your flow:

SettingExample
Text✅ Yes
Callback Dataconfirm_yes

When pressed:

  1. User sees the button clicked
  2. Your bot receives the callback data
  3. You can trigger a flow based on that data

URL Button

Opens a link:

SettingExample
Text🌐 Visit Website
URLhttps://example.com

Handling Button Clicks

For Reply Keyboards

User sends the button text as a message → use a Message Trigger or Switch node:

For Inline Buttons

Use a Callback Trigger or Message Trigger with callback filter:


Dynamic Keyboards

Create keyboards based on data:

Example: Product List

Each product becomes a button!


Removing Keyboards

To remove a reply keyboard:

Use the Reply Markup node with type: remove_keyboard

This clears the keyboard from the user's screen.


Common Patterns

Confirmation Dialog

Pagination

Page 1 of 5

[⬅️ Prev] [1] [2] [3] [➡️ Next]

Best Practices

Keep It Simple

Don't overwhelm users — 4-6 buttons max per keyboard.

Use Clear Labels

Button text should be obvious:

  • ✅ "📧 Contact Support"
  • ❌ "CS"
Add Emojis

Emojis make buttons easier to scan and more engaging.

Handle All Cases

Always have a way to go back or cancel.


Advanced: Quick Syntax

For simple keyboards, you can use text shortcuts:

Reply Keyboard:

Option A, Option B; Cancel

(Semicolons create new rows)

Inline Keyboard:

✅ Yes|yes, ❌ No|no; 📞 Call|url:tel:+1234567890

(Pipe separates text|data)


Next Steps