React for the Telegram Bot API

Build bots that feel like React apps.

Teact turns JSX, hooks, routing, and keyboards into Telegram experiences — the same React you already know, with a runtime tuned for grammY and Bun.

$ bun create teact my-bot

Packages

@teactjs/*

Adapter

grammY

Runtime

Bun-first

License

MIT

src/index.tsx
import { createBot } from "@teactjs/core";
import { Message, Button, InlineKeyboard } from "@teactjs/ui";
import { TelegramAdapter } from "@teactjs/telegram";

// Components + hooks — same as you know them
const bot = createBot({
  component: App,
  adapter: new TelegramAdapter(),
  token: process.env.TELEGRAM_BOT_TOKEN,
});

bot.start();

Why Teact

Ship inline keyboards, media, polls, and payments with declarative UI — then layer routing, sessions, i18n, and streaming when you need them.

Ecosystem

  • @teactjs/core, ui, telegram, plugin-sdk
  • Storage, testing utils, CLI & create-teact

File-based routing

Guards, params, and navigate modes that feel like a mini SPA inside Telegram.

Conversations & forms

Multi-step flows with useConversation, useForm, and declarative prompts.

Real React

Hooks, context, Suspense — same patterns you use on the web, compiled with Bun.

CLI that ships

Scaffold, dev with HMR, build for production, and generate components or plugins.

From zero to first message

Three steps, then iterate

01

Scaffold

Run create-teact, pick a template, and toggle plugins (storage, auth, i18n, and more).

02

Configure

Drop your bot token into .env and adjust teact.config.ts when you add plugins.

03

Ship

Use teact dev with HMR locally, then teact build and run with polling or webhooks.

Built on a stack you already trust

React patternsTelegram Bot APIBun runtimegrammY adapterFull docs

Frequently asked

Do I need to know grammY?

Teact uses grammY under the adapter. You can stay in JSX land for most bots and drop down when you need raw API access.

Is this production-ready?

The stack is designed for real bots: sessions, webhooks, storage drivers, tests with MockAdapter, and a production build path.

Can I use npm or pnpm?

Yes. The scaffolder lets you pick bun, npm, or pnpm. Bun is the default sweet spot for dev speed.

Where do routes and commands live?

Use createRouter for file-style paths and pass commands into createBot for Telegram menu commands and deep links.

Ready to prototype?

Installation, routing, hooks, and package reference live in the docs. Toggle theme anytime from the navbar.

Open documentation