npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

tgui-dashboard

v0.2.0

Published

Data-dense / dashboard components for Telegram Mini Apps UI (@telegram-apps/telegram-ui): DataTable, StatCard and more, themed with --tgui-- design tokens.

Downloads

333

Readme

tgui-dashboard

Data-компоненты для Telegram Mini Apps UI — desktop / admin-компаньон к мобильному киту.

npm version license for telegram-ui TypeScript PRs welcome

English · Русский

Зачем

@telegram-apps/telegram-ui отлично делает нативный мобильный «хром» — списки, ячейки, секции, кнопки — но в нём нет таблиц, графиков, воронок и KPI-карточек. Как только начинаешь делать админку, экран аналитики или десктоп-дашборд, упираешься в эту стену.

tgui-dashboard закрывает пробел. Каждый компонент читает CSS-переменные telegram-ui --tgui--*, поэтому автоматически наследует реальную тему пользователя, светлый/тёмный режим и платформу — выглядит как часть кита, а не чужеродная вставка.

  • 🎨 Нативный вид — на токенах --tgui--, следует за живой темой
  • 📊 Те самые тяжёлые компоненты — таблица, area-график, спарклайн, воронка, KPI, master-detail, badge, skeleton
  • 🪶 Headless-мощьDataTable на TanStack Table, графики на Recharts
  • 🧩 Маленький и tree-shakeable — ESM + CJS, полные типы TypeScript, MIT
  • 🌗 Светлая и тёмная тема из коробки (превью выше)

Соответствие: цвета, радиусы и типографика взяты из токенов @telegram-apps/telegram-ui v2.1.13 — Card 20px, Section 12px, hint #707579, green #31D158, а каждый компонент читает живые переменные --tgui--, поэтому внутри реального Telegram точно следует теме пользователя.

Установка

npm i tgui-dashboard @tanstack/react-table recharts
# peers: react, react-dom и @telegram-apps/telegram-ui (для переменных темы)

Оберни приложение в AppRoot из telegram-ui, чтобы переменные --tgui-- были определены:

import { AppRoot } from '@telegram-apps/telegram-ui';
import '@telegram-apps/telegram-ui/dist/styles.css';

export default function App() {
  return (
    <AppRoot>
      <Dashboard />
    </AppRoot>
  );
}

Компоненты

StatCard

Компактная KPI-карточка. Разложи несколько в CSS-грид — получишь шапку дашборда.

import { StatCard } from 'tgui-dashboard';

<StatCard label="Новые лиды" value={128} delta={12} hint="за 7 дней" />
<StatCard label="КЭВ назначено" value={34} delta={-4} hint="за 7 дней" />
<StatCard label="Ср. ответ" value="1:40" />

label · value · delta (%, +зелёная ▲ / −красная ▼) · hint · icon

DataTable

Таблица с сортировкой и пагинацией на headless-движке TanStack Table.

import { DataTable } from 'tgui-dashboard';
import type { ColumnDef } from '@tanstack/react-table';

const columns: ColumnDef<Lead>[] = [
  { accessorKey: 'name', header: 'Клиент' },
  { accessorKey: 'stage', header: 'Стадия' },
];

<DataTable columns={columns} data={leads} pageSize={20} onRowClick={openLead} />

columns · data · pageSize=10 · enableSorting=true · enablePagination=true · emptyText · onRowClick

AreaChart

Area-график на Recharts, темизированный под палитру токенов.

import { AreaChart } from 'tgui-dashboard';

<AreaChart
  data={daily}
  xKey="day"
  series={[{ key: 'leads', label: 'Лиды' }, { key: 'booked', label: 'КЭВ' }]}
  height={240}
/>

data · xKey · series[{ key, label?, color? }] · height=240

Sparkline

Крошечный трендовый график без зависимостей — для инлайна (например, внутри StatCard).

import { Sparkline } from 'tgui-dashboard';

<Sparkline data={[4, 6, 5, 8, 7, 11, 14]} />

data · width=120 · height=36 · color · area=true · strokeWidth=2

Funnel

Горизонтальная воронка конверсии — по бару на стадию, с процентом конверсии.

import { Funnel } from 'tgui-dashboard';

<Funnel steps={[
  { label: 'Квалификация', value: 128 },
  { label: 'Прогрев', value: 86 },
  { label: 'Запись (КЭВ)', value: 41 },
  { label: 'BOOKED', value: 27 },
]} />

steps[{ label, value, color? }] · showPercent=true

MasterDetail

Двухпанельный лейаут «список + деталь» (например, список лидов рядом с выбранным диалогом). Заточен под десктоп/админку.

import { MasterDetail } from 'tgui-dashboard';

<MasterDetail
  list={<LeadsList onSelect={setLead} />}
  detail={lead ? <Conversation lead={lead} /> : null}
  listWidth={340}
/>

list · detail · listWidth=340 · minHeight=480 · emptyDetail

Badge

Небольшой пилл для статусов / категорий / стадий воронки.

import { Badge } from 'tgui-dashboard';

<Badge tone="green">ААА</Badge>
<Badge tone="accent">ВВВ</Badge>
<Badge tone="gray">ССС</Badge>
<Badge tone="accent" variant="solid">Новый</Badge>

tone: 'accent' | 'green' | 'red' | 'gray' · variant: 'soft' | 'solid'

Skeleton

Пульсирующий плейсхолдер для состояний загрузки.

import { Skeleton } from 'tgui-dashboard';

<Skeleton width={180} height={20} />
<Skeleton width={40} height={40} radius="50%" />

width · height · radius

Темизация

Экспорт tokens отдаёт CSS-переменные telegram-ui как готовые строки var(...), чтобы твои компоненты попадали в стиль кита:

import { tokens } from 'tgui-dashboard';

<div style={{ background: tokens.cardBg, color: tokens.text, borderRadius: 20 }} />

bg · secondaryBg · tertiaryBg · sectionBg · cardBg · headerBg · text · hint · subtitle · sectionHeader · link · accent · divider · outline · skeleton · green · destructive · fontFamily · series[]

Роадмап

  • [x] AreaChart / Sparkline
  • [x] Funnel
  • [x] MasterDetail
  • [x] Badge, Skeleton
  • [ ] Фильтры колонок и фасетный поиск для DataTable
  • [ ] BarChart / Donut
  • [ ] Виртуализация строк для очень больших таблиц

Контрибьютинг

Issues и PR приветствуются. Держите компоненты на токенах (без хардкод-цветов), чтобы они оставались theme-aware.

npm i && npm run build

Лицензия

MIT © skiddgoddamn

Превью — иллюстративные SVG-макеты на реальной палитре telegram-ui v2.1.13.