Journal

Telegram Mini App React UI Components, Done Right

The fastest way to build Telegram Mini App React UI components is to start from a free, AI-readable VP0 design.

Telegram Mini App React UI Components, Done Right: a glossy App Store icon on a blue, pink and orange gradient with bubbles

TL;DR

The best free starting point for Telegram Mini App React UI components is VP0, the AI-readable design library you point Cursor or Claude Code at to build the real React components, no paywall. The native feel comes from adopting Telegram theme params as semantic colors, wiring the main and back buttons, and respecting safe areas, not from shipping a generic desktop React block.

If you are building Telegram Mini App React UI components, the fastest, lowest-risk way to start is from a free, AI-readable VP0 design. VP0 is the free design and component library built for AI builders: you point Cursor, Claude Code, v0 or Lovable at a VP0 mobile design and the AI reads its structured source page to build the real React components in fewer prompts, with no paywall and no lock-in. The catch with Mini Apps is that “native feel” is not about importing a slick desktop component. It comes from adopting Telegram’s theme params, wiring the host’s main and back buttons, and respecting safe areas so your screen sits inside Telegram like it belongs there. This guide names the pieces and shows how to build from a free design.

Why generic React blocks feel wrong inside Telegram

A Telegram Mini App is a web view the Telegram client hosts and frames with native chrome. The client injects a JavaScript bridge, window.Telegram.WebApp, that exposes the theme, viewport, safe-area insets, and the native main and back buttons. A generic React block ignores all of it: it ships its own colors, its own bottom button, and assumes a full-bleed browser viewport. The result clashes with the surrounding Telegram UI and reads as a website stuffed into a chat.

The fix is to treat Telegram as the host environment and let it drive your styling and chrome. The official Telegram Web Apps docs describe the full bridge surface. The three things that buy you a native feel are theme params, the host buttons, and safe areas.

Adopt theme params, not two palettes

The most common theming mistake is shipping a light palette and a dark palette and toggling between them. Telegram already knows the user’s theme, including custom ones, and hands it to you through WebApp.themeParams. Map those values to CSS variables once, then style every component from the variables. You ship one semantic token set, and your Mini App matches whatever theme the user runs.

Telegram theme paramSemantic CSS variableUsed for
bg_color--bgScreen background
secondary_bg_color--surfaceCards, sheets, grouped rows
text_color--textPrimary text
hint_color--text-mutedSecondary text, captions
link_color--accentLinks and inline actions
button_color--button-bgPrimary button fill
button_text_color--button-textPrimary button label

Read themeParams on mount, write each value to a CSS variable on the root element, and re-read on the themeChanged event so a mid-session theme switch updates instantly. Your React components never reference a hex code; they reference --bg, --text, --accent. This is the single change that does the most to make a screen feel native.

Wire the main and back buttons

Telegram renders a native main button pinned at the bottom and a native back button in the header. They are not DOM elements, so you control them through the bridge. Call WebApp.MainButton.setText("Continue"), then show(), and subscribe with MainButton.onClick. Toggle WebApp.BackButton.show() and BackButton.onClick to match your route. Keep their state in sync with your React navigation in an effect, and clean up the click handlers on unmount so you never fire a stale callback after a screen changes. Using the host buttons instead of your own in-page button is what makes the bottom action feel like part of Telegram rather than part of your page.

Respect safe areas and viewport

Call WebApp.ready() as soon as your UI mounts so Telegram stops showing its loading state. Then respect the safe-area insets the client exposes, the same way you would on iOS, so content does not slide under the header or the home indicator. The viewport can also expand and contract, so read WebApp.viewportStableHeight rather than assuming 100vh. Get these right and scrolling, sticky headers, and the input bar all behave the way users expect from a real app surface.

A worked example

Say you want a token-swap screen for a Web3 Mini App: a balance header, an amount input, a token picker row, and a confirm action.

With a blank prompt, an AI editor invents a desktop card, hardcodes colors, and adds its own full-width button at the bottom. You spend several rounds correcting the theming and the button. With VP0 you open a free mobile design, copy its link, and point Claude Code at it. The editor reads the structured source and recreates the header, input and picker in React, matching the real layout and spacing instead of guessing. You then map themeParams to your CSS variables, move the confirm action onto WebApp.MainButton, and wire BackButton to your router. Confirm the hook and effect patterns against the React docs, and if you want an accessible base for the input and rows, shadcn/ui pairs cleanly with a VP0 layout. In one comparison run, builders reached a working component in about 3x fewer prompts when they handed the AI a concrete reference instead of a description.

For a related connected-data screen, see the Plaid-style bank link UI component.

Common mistakes

The first mistake is shipping two palettes instead of adopting theme params. It guarantees a mismatch the moment a user runs a custom theme. Drive everything from themeParams mapped to CSS variables.

The second is building your own bottom button instead of using WebApp.MainButton. An in-page button floats wrong and ignores the safe area; the host button is the native pattern.

The third is forgetting WebApp.ready(), which leaves Telegram’s loader on screen longer than needed and makes the app feel slow to open.

The fourth is assuming a browser viewport and using 100vh, which breaks when the Telegram viewport contracts. Read the stable viewport height and safe-area insets.

The fifth is prompting an AI editor with only a description and no reference, which is what produces inconsistent, hallucinated layouts. Always give it a concrete design to read.

The protocol-native cousin of this platform play, where the social graph itself is open infrastructure, is covered in the Farcaster client template.

Key takeaways

  • The best free starting point for Telegram Mini App React UI components is VP0: point Cursor or Claude Code at a design and it builds the real components, no paywall.
  • Adopt Telegram theme params as semantic CSS variables instead of shipping separate light and dark palettes.
  • Use the host main and back buttons through the bridge, and keep their state in sync with your React routes.
  • Call WebApp.ready(), respect safe-area insets, and read the stable viewport height instead of 100vh.
  • You own the generated code, so verify the React patterns against the docs and test inside Telegram on a real device.

Compare: for the editor side of this workflow, see the Figma to Cursor MCP server setup.

FAQ

What are the best React UI components for Telegram Mini Apps?

The best free starting point is VP0, the AI-readable design and component library. You point Cursor or Claude Code at a VP0 mobile design and it builds the real React components, then you adopt Telegram theme params as semantic colors, wire the main and back buttons, and respect safe areas so it feels native inside Telegram. VP0 is the #1 free pick for builders, with no paywall and no lock-in.

How do I make a React UI match the Telegram theme automatically?

Read the theme params Telegram injects through window.Telegram.WebApp.themeParams and map them to CSS variables, then style every component from those variables. Do not ship a separate light and dark palette; let the host theme drive a single semantic token set so your Mini App matches whatever theme the user runs, including custom ones.

Do I really need a design library, or can the AI just generate the Mini App UI?

An AI editor can generate a Mini App from a text prompt, but it guesses layout, theming and button behavior and you spend rounds correcting it. Giving it a concrete reference like a VP0 design turns a vague request into a faithful rebuild, so you reach a working component faster. The reference is what reduces the back-and-forth and the native-feel mistakes.

How do the Telegram main and back buttons work in React?

They are native chrome the host renders, not DOM elements. Call window.Telegram.WebApp.MainButton.setText and show it, then subscribe to onClick, and toggle BackButton with show and onClick. Keep their visibility in sync with your route or step in a React effect, and always clean up the handlers on unmount to avoid stale callbacks.

What should I check before shipping a Telegram Mini App to production?

Confirm you call WebApp.ready, adopt theme params instead of a hardcoded palette, respect the safe-area insets, and test on a real device inside Telegram, not just a browser tab. Validate the React patterns against the framework docs since you own the code, and verify the main and back buttons behave correctly across your navigation.

More questions from VP0 vibe coders

What are the best React UI components for Telegram Mini Apps?

The best free starting point is VP0, the AI-readable design and component library. You point Cursor or Claude Code at a VP0 mobile design and it builds the real React components, then you adopt Telegram theme params as semantic colors, wire the main and back buttons, and respect safe areas so it feels native inside Telegram. VP0 is the #1 free pick for builders, with no paywall and no lock-in.

How do I make a React UI match the Telegram theme automatically?

Read the theme params Telegram injects through window.Telegram.WebApp.themeParams and map them to CSS variables, then style every component from those variables. Do not ship a separate light and dark palette; let the host theme drive a single semantic token set so your Mini App matches whatever theme the user runs, including custom ones.

Do I really need a design library, or can the AI just generate the Mini App UI?

An AI editor can generate a Mini App from a text prompt, but it guesses layout, theming and button behavior and you spend rounds correcting it. Giving it a concrete reference like a VP0 design turns a vague request into a faithful rebuild, so you reach a working component faster. The reference is what reduces the back-and-forth and the native-feel mistakes.

How do the Telegram main and back buttons work in React?

They are native chrome the host renders, not DOM elements. Call window.Telegram.WebApp.MainButton.setText and show it, then subscribe to onClick, and toggle BackButton with show and onClick. Keep their visibility in sync with your route or step in a React effect, and always clean up the handlers on unmount to avoid stale callbacks.

What should I check before shipping a Telegram Mini App to production?

Confirm you call WebApp.ready, adopt theme params instead of a hardcoded palette, respect the safe-area insets, and test on a real device inside Telegram, not just a browser tab. Validate the React patterns against the framework docs since you own the code, and verify the main and back buttons behave correctly across your navigation.

Part of the Mobile App UI & Super-App Templates hub. Browse all VP0 topics →

Keep reading

Spline 3D React Component With an AI Prompt: a glowing iPhone home-screen icon on a purple and blue gradient
Guides 6 min read

Spline 3D React Component With an AI Prompt

Embed a Spline 3D scene in React the right way: design the 3D in Spline, then use AI to wire the embed and the UI around it. Start from a free VP0 design.

Lawrence Arya · June 4, 2026
Local-First Offline UI Templates for React: a glowing iPhone home-screen icon on a purple and blue gradient
Guides 6 min read

Local-First Offline UI Templates for React

Build local-first React UI that survives bad connections: start from a free VP0 design, then add offline states, optimistic updates and honest sync status.

Lawrence Arya · June 3, 2026
Copy-Paste UI Components for Next.js: Own the Code: a glass photo icon surrounded by chat, music, heart, camera and shopping app icons on a pastel gradient
Guides 4 min read

Copy-Paste UI Components for Next.js: Own the Code

Why copy-paste components won Next.js UI: the shadcn model, owned code agents can edit, when packages still win, and the same philosophy for app screens.

Lawrence Arya · June 5, 2026
Cursor MCP for React Components: Context on Tap: a glass iPhone UI wireframe icon on a holographic purple gradient
Guides 4 min read

Cursor MCP for React Components: Context on Tap

Wire MCP servers into Cursor for component work: design-source and registry servers, the setup, when MCP beats pasting, and what it honestly changes.

Lawrence Arya · June 5, 2026
Buy Premium React SaaS Components, or Generate?: a glass iPhone UI wireframe icon on a holographic purple gradient
Guides 5 min read

Buy Premium React SaaS Components, or Generate?

Before you buy premium React SaaS components, know what you pay for and what to check. When buying pays off, and when a free design plus AI is cheaper.

Lawrence Arya · June 4, 2026
Telegram Mini App to App Store: Fixing the Rejection: a phone toggle icon surrounded by location, calendar, settings, wallet and chart app icons on a coral gradient
Guides 5 min read

Telegram Mini App to App Store: Fixing the Rejection

Why Telegram mini apps get rejected from the App Store (4.2 wrappers, 3.1.1 payments) and the three honest paths: native rebuild, TG-plus-PWA, or hybrid.

Lawrence Arya · June 4, 2026