Quick answer: Telegram widgets are small interactive apps that live inside a chat message: order cards, plan pickers, polls, mini games and even Gram payments. Bots send them with the new sendWidget method in Bot API 10.4, released on November 9, 2026. Right now they work in private chats with bots. Groups, inline mode and forwards are still on Telegram's test server.
Until Bot API 10.4, a Telegram bot had two ways to show anything interactive. It could send a message with a few inline buttons, or open a Mini App: a full web page in a separate window. Most real flows ended up as a long chain of bot messages somewhere in between.
Widgets add a third option. A widget is a tiny HTML app drawn right in the message bubble. It stays visible while you scroll, matches the chat's colors, and talks to your bot without opening a browser. Below: what widgets can do, where they work, their limits, how Gram payments work inside them, and a working example you can copy.
What are Telegram widgets?
A Telegram widget is one self-contained HTML document (HTML plus inline CSS and JavaScript) that a bot sends as a message. Telegram runs it in a sandbox and draws it inside the message bubble. Telegram's widget docs describe it as part of the message, not a page the user opens.
Five things make widgets different from anything bots had before:
- They live in the chat. No separate window. The widget stays on screen while the user scrolls.
- They have no internet access.
fetchand WebSockets are switched off. The only way out is a short request (up to 64 bytes) to your bot. - They look native. Widgets get the chat's theme colors and button styles automatically, in light and dark mode.
- Only your bot changes what they show. Each widget carries small pieces of state (up to 1,024 bytes each) that only the bot can edit. When it does, the widget redraws.
- The code is fixed once sent. To change the layout, you send a new widget.
Telegram Desktop added widget support in version 7.4 on November 5, 2026. Apps that don't support widgets show the message caption instead, so always send one.
Not the old "Telegram widgets": search for "Telegram widgets" and you'll also find the 2021 home-screen widget for your phone, plus website widgets like the Telegram login button and post embeds. Those are different features. This guide is about the new bot widgets that appear inside chats.
What can you build with Telegram widgets?
Anything that fits on one card and needs a few taps. Some ideas that earn money or save support time:
- Order and booking cards. Show the order or the free slots, and let the user confirm, cancel or pick a time with one tap. The card updates in place instead of sending five new messages.
- Plan pickers and upgrades. Basic vs Pro, monthly vs yearly, with the current plan highlighted. This is the example we build below.
- Payments in Gram. A "Pay" button that opens the user's Telegram wallet for approval, then shows "Paid" once your bot confirms it.
- Quizzes, polls and onboarding. Multi-step flows that move forward inside one message, so the chat doesn't fill up.
- Status cards. Support tickets, deliveries, account usage. Your bot edits the widget's data and the card refreshes silently.
- Mini games and leaderboards. Shared widgets keep one state for everyone who sees them, which suits scores and votes once groups go live.
If you run Telegram channels: bots can't post widgets in channels, and forwarding widgets is still test-server only. For now, use them in your bot's private chat, where subscribers already come for access, payments or support.
Widgets vs Mini Apps vs inline buttons
| Inline buttons | Widgets | Mini Apps | |
|---|---|---|---|
| Where it shows | Under a message | Inside the message bubble | A separate full-screen window |
| Custom design | No, text buttons only | Yes, HTML, CSS and JS up to 32 KB | Yes, any web page |
| Text input | No, the user types a reply | No, form fields are removed | Yes |
| Internet access | Not needed | None, it talks only to your bot | Yes |
| Hosting needed | No | No, the code ships in the message | Yes, an HTTPS website |
| Best for | Menus and yes/no choices | Small cards that update in place | Catalogs, dashboards, long forms |
Simple rule: if the user only needs to pick one of a few options, use inline buttons. If they should see something and change it in place (an order, a plan, a score), use a widget. If they need to type, browse or load live data, use a Mini App.
Where Telegram widgets work right now
| Where | Status (November 2026) |
|---|---|
| Private chat between a user and your bot | Live |
| Groups and supergroups | Test server only |
| Inline mode | Test server only |
| Forwards | Test server only |
| Channels | Bots can't post widgets in channels |
Widgets sent in production are protected content, so users can't forward them yet. Design each one for the private chat it lives in. Source: Telegram Bot API changelog.
Telegram widget limits (cheat sheet)
- Code size: 32 KB of HTML, and no more than 4 KB after compression.
- State: 1,024 bytes for the chat state and 1,024 bytes for the shared state.
- Requests to your bot: up to 64 bytes in and 1,024 bytes back, 5 requests per 5 seconds per user, and your bot must answer within 15 seconds.
- Size on screen: 200 to 600 px wide and 50 to 600 px tall, with no scrolling inside the widget.
- Removed: network calls, text inputs, dropdowns, iframes, video, external scripts and custom fonts.
- Storage: 4 KB of
localStorageper message, kept on the device and never synced. - Runtime: about 300 ms of JavaScript per second, 8 MB of memory and 2,000 page elements.
The 4 KB compressed limit is the one that bites. A developer who built a trading widget in launch week also hit the 1 KB state limit with real data. Test with your largest payload, and count bytes, not characters.
How to build a Telegram widget (step by step)
Here's a minimal plan picker. The user taps Basic or Pro, the bot saves the choice, and the widget updates in place. No Mini App and no hosting. You need a bot token from @BotFather and Python 3.9 or newer.
Step 1: Write the widget
Save this as plan_widget.html. It reads its state from TelegramWidget.chatData, sends taps to the bot with TelegramWidget.request(), and redraws when the bot changes the state.
<p><b>Choose your plan</b></p>
<button id="basic">Basic</button>
<button id="pro">Pro</button>
<p id="status">Tap a plan.</p>
<script>
const tw = window.TelegramWidget;
const statusEl = document.getElementById('status');
// Draw from state: Telegram can recreate the widget at any time
function draw() {
const state = tw.chatData ? JSON.parse(tw.chatData) : null;
if (state && state.plan) statusEl.textContent = 'Current plan: ' + state.plan;
}
function choose(plan) {
statusEl.textContent = 'Saving...';
tw.request('plan:' + plan).catch((err) => {
statusEl.textContent = 'Error: ' + err.code;
});
}
['basic', 'pro'].forEach((plan) => {
document.getElementById(plan).addEventListener('click', () => choose(plan));
});
tw.onEvent('chatDataChanged', draw); // the bot changed the state
draw();
tw.ready();
</script>
Step 2: Send it with sendWidget
If your bot library doesn't support Bot API 10.4 yet, call the HTTP API directly, as this example does with requests. The caption shows in chat lists, notifications and on apps without widget support. allow_queries lets the widget send requests to your bot.
import json
import requests
TOKEN = "YOUR_BOT_TOKEN" # from @BotFather
API = f"https://api.telegram.org/bot{TOKEN}"
WIDGET_HTML = open("plan_widget.html", encoding="utf-8").read()
def call(method, **params):
return requests.post(f"{API}/{method}", json=params, timeout=40).json()
def send_plan_picker(chat_id):
call(
"sendWidget",
chat_id=chat_id,
html=WIDGET_HTML,
caption="Choose your plan", # shown on apps without widget support
allow_queries=True, # without this, every tap is refused
)
Step 3: Answer taps and update the widget
When the user taps a plan, your bot gets a widget_query update. Answer it with answerWidgetQuery within 15 seconds, then save the choice with editMessageWidgetData. The widget receives a chatDataChanged event and redraws.
def on_widget_query(q):
# q["data"] is what the widget sent, e.g. "plan:pro". Never trust it.
plan = q.get("data", "").removeprefix("plan:")
ok = plan in ("basic", "pro")
# 1) Answer within 15 seconds
call("answerWidgetQuery", widget_query_id=q["id"], data="ok" if ok else "invalid")
# 2) Save the choice in the widget's chat state, so the widget redraws
if ok:
# (save the plan to your database here)
call(
"editMessageWidgetData",
chat_id=q["chat"]["id"],
message_id=q["message_id"],
chat_data=json.dumps({"plan": plan}),
)
offset = 0
while True:
updates = requests.get(
f"{API}/getUpdates",
params={
"offset": offset,
"timeout": 30,
"allowed_updates": json.dumps(["message", "widget_query"]),
},
timeout=40,
).json()["result"]
for update in updates:
offset = update["update_id"] + 1
message = update.get("message")
if message and message.get("text") == "/plans":
send_plan_picker(message["chat"]["id"])
elif "widget_query" in update:
on_widget_query(update["widget_query"])
Run the script, send /plans to your bot and tap a plan. A few rules from Telegram's docs worth following from day one:
- Always send a caption. It's what users on older apps see.
- Treat widget data as untrusted. Anyone can send any 64 bytes, so check it on the bot side, as the example does.
- Draw from state. Telegram can destroy and recreate a widget at any time, so never keep important data only in JavaScript variables.
- Use theme variables such as
var(--tg-theme-text-color)instead of fixed colors, so the widget looks right in dark mode. - Show progress. Requests can take a moment, so show "Saving..." and every error.
How Gram payments work inside widgets
Widgets can ask users to pay in Gram (the new name for Toncoin) through Telegram's built-in wallet. The user approves every payment on Telegram's own confirmation screen. The flow:
- The widget checks that
TelegramWidget.walletis available before showing a Pay button. - On tap, it calls
request(data, { wallet: true }), and your bot receives the user's wallet details with the query. - Your bot answers with a TON Connect-style transaction: the amount in nanotons and an expiry time.
- The widget calls
wallet.sendTransaction(). Telegram shows the bot, the amount and the destination, and the user confirms. - Your bot gets a
sent_transactionquery and checks the transaction on the blockchain before delivering anything.
Important: never mark an order as paid just because the widget says so. Verify it on-chain. If a request times out, the payment may still have gone through, so check the order before you retry.
The timing is good. Telegram is rolling out its native Gram wallet to more users right now, and Pavel Durov said more than 700,000 self-custodial wallets were created in 48 hours (The Block). More users with a wallet already set up means a shorter path from "Pay" to paid.
Should you add widgets to your bot now?
- Yes, if users already talk to your bot in private chat: orders, bookings, subscriptions, support. One widget can replace a whole chain of messages.
- Wait, if your flow lives in groups or channels. Those are still test-server only.
- Keep a fallback. A clear caption plus normal inline buttons covers users on older apps.
Planning a bot around widgets? Our Telegram bot development cost guide has real price ranges, and our guide to custom Telegram bot development explains when custom work is worth it.
Frequently asked questions
Are Telegram widgets the same as home-screen widgets?
No. Home-screen widgets are phone shortcuts to your chats, added in 2021. Bot widgets are small apps that a bot sends inside a chat message, added in Bot API 10.4 in November 2026.
Can I post a widget in my Telegram channel?
Not right now. Bots can't send widgets to channels, and forwarding widgets is still test-server only. Use them in your bot's private chat for now.
Do I need a server or web hosting?
You need a running bot to send widgets and answer taps, but no website. The widget's code travels inside the message.
Can a widget load data from my API?
Not directly, because widgets have no network access. The widget asks your bot with request(), and your bot answers with up to 1 KB of data or edits the widget's state.
Can widgets take payments?
Yes, in Gram through the user's Telegram wallet. The user approves each payment, and your bot must verify it on the blockchain.
Can an AI agent send widgets?
Yes. Any bot can send a widget, so an AI agent can reply with a booking card or an order it filled in, instead of a wall of text. See our guide to building a Telegram AI agent.
Final thoughts
Widgets turn a bot reply into a small app, without the weight of a Mini App. For now they're limited to private chats, so the quick wins are order cards, plan pickers and payment buttons in the conversations your bot already has. Start with one card that replaces your longest message chain, then build from there.
Want widgets in your bot? Weego can add widgets, Gram payments and AI to your Telegram bot. Talk to Weego about your bot →
