Telegram Web K uses two co-existing rendering models: the majority of the codebase consists of hand-crafted vanilla TypeScript components that manipulate the DOM directly, while newer additions adopt SolidJS for fine-grained reactivity. Both models live side by side inDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/TelegramOrg/Telegram-web-k/llms.txt
Use this file to discover all available pages before exploring further.
src/components/ — .ts files are vanilla TS, .tsx files are SolidJS. Understanding which model a file uses is as simple as looking at its extension.
Rendering models
- Vanilla TypeScript (.ts)
- SolidJS (.tsx)
HTMLElement. There is no virtual DOM or diffing — mutations happen directly on real DOM nodes.src/components/, a .tsx extension reliably signals a SolidJS component. Paired files like checkboxField.ts and checkboxFieldTsx.tsx expose the same widget in both paradigms so legacy code can import the .ts version while newer code uses the .tsx version.Component categories
Chat area
The chat area undersrc/components/chat/ contains the most performance-critical components.
Message bubbles — src/components/chat/bubbles.ts
Message bubbles — src/components/chat/bubbles.ts
bubbles.ts is one of the largest files in the project. It manages the full message rendering pipeline: building bubble DOM nodes for text, photos, videos, documents, polls, and service messages; grouping adjacent messages from the same author (bubbleGroups.ts); and virtual scrolling to keep the DOM light for long histories.Individual bubble parts live in src/components/chat/bubbles/ (sub-files per content type) and src/components/chat/bubbleParts/.Chat input — src/components/chat/input.ts
Chat input — src/components/chat/input.ts
contenteditable, emoji/sticker insertion, voice recording triggers, reply/edit state, and the “send” button context menu. Autocomplete helpers (autocompleteHelper.ts, mentionsHelper.ts, commandsHelper.ts, emojiHelper.ts) are injected as collaborators.Topbar — src/components/chat/topbar.ts
Topbar — src/components/chat/topbar.ts
pinnedMessage.ts, pinnedContainer.ts). Sponsored-message and live-stream topbars have their own overlay components (topbarSponsored.tsx, topbarLive/).Context menu — src/components/chat/contextMenu.ts
Context menu — src/components/chat/contextMenu.ts
Reactions — src/components/chat/reactions.ts & reaction.ts
Reactions — src/components/chat/reactions.ts & reaction.ts
reactions.ts controls the floating reaction bar and inline reaction counters under messages. reaction.ts wraps a single emoji reaction with its animated Lottie sticker, counter, and pressed state. The reactions context menu is in reactionsMenu.ts.Sidebar left
Settings tabs undersrc/components/sidebarLeft/tabs/ each extend SliderSuperTab, which provides the slide-in/out animation and scrollable container.
| File | Purpose |
|---|---|
settings.ts | Root settings screen |
editProfile.ts | Edit name, bio, username, birthday |
chatFolders.ts | Folder list and reorder |
editFolder.ts | Folder rule editor |
generalSettings.ts | Notifications, privacy links |
background.ts | Chat wallpaper picker |
language.tsx | Language switcher (SolidJS) |
notifications.tsx | Notification settings (SolidJS) |
powerSaving.ts | Lite mode / animation controls |
stickersAndEmoji.ts | Sticker and emoji pack manager |
src/components/sortedDialogList.ts backed by src/components/dynamicVirtualList/.
Sidebar right
src/components/sidebarRight/ holds peer-info panels. src/components/peerProfile.tsx (SolidJS) renders the combined profile view for users, groups, and channels, including bio, shared media tabs, and admin lists.
Popups
All modal dialogs live undersrc/components/popups/. They extend a common PopupElement base class and are shown by calling their static .show() method or by instantiating and appending to the document.
Media viewer
src/components/appMediaViewer.ts and its siblings (appMediaViewerBase.ts, appMediaViewerNew.ts, appMediaViewerAvatar.ts, appMediaViewerRtmp.ts) implement the full-screen photo/video viewer with swipe navigation, zoom, download, and forward actions.
Media playback
src/components/appMediaPlaybackController.ts is a singleton that manages audio/video playback state across the whole app — play queue, speed controls, mini-player, and keyboard shortcuts. The src/components/audio.ts component renders the in-chat audio player bubble.
Emoticons dropdown
src/components/emoticonsDropdown/ is the emoji, sticker, and GIF picker panel:
Call components
Voice and video calls have dedicated directories:src/components/call/— one-to-one call UI (accept/decline overlay, participant video, mic button)src/components/groupCall/— group voice chat UI (participant list, mute icons, stage video tiles)
Virtual lists and scrolling
Long lists (dialogs, search results, message history) use virtual rendering to avoid thousands of DOM nodes.| Component | Description |
|---|---|
src/components/verticalVirtualList.tsx | Generic SolidJS vertical virtual list |
src/components/deferredSortedVirtualList.tsx | Virtual list with deferred, sorted inserts for dialog ordering |
src/components/dynamicVirtualList/ | Older imperative virtual list used by the dialog sidebar |
src/components/scrollable.ts | Custom scrollable container with momentum and intersection tracking |
Lazy loading
Media thumbnails and Lottie stickers are loaded on demand through a queue system so off-screen content never blocks rendering.LazyLoadQueue — src/components/lazyLoadQueue.ts
LazyLoadQueue — src/components/lazyLoadQueue.ts
IntersectionObserver to track element visibility and processes load tasks only for elements that have been seen. Integrates with useHeavyAnimationCheck to pause loading during heavy transition animations.LazyLoadQueueBase — src/components/lazyLoadQueueBase.ts
LazyLoadQueueBase — src/components/lazyLoadQueueBase.ts
LazyLoadQueueRepeat / LazyLoadQueueRepeat2
LazyLoadQueueRepeat / LazyLoadQueueRepeat2
Animation infrastructure
AnimationIntersector — src/components/animationIntersector.ts
AnimationIntersector — src/components/animationIntersector.ts
chat, emoticons-dropdown, STICKERS-POPUP, etc.) so entire groups can be paused at once — for example, pausing all chat animations while a popup is open.Lottie animations — src/components/lottieAnimation.tsx
Lottie animations — src/components/lottieAnimation.tsx
Document or URL and handles decode, play/pause lifecycle, and color replacement for themed stickers. The underlying worker lives in src/lib/rlottie/.Transition system — src/components/transition.ts
Transition system — src/components/transition.ts
src/components/singleTransition.ts manages a single in-progress transition at a time.