jtai工业级 UI 框架 · 开源 · jtUI v1.0-rc

jtUI

Vue 般简单的 C++ 桌面 UI 框架。纯 C++20,原生帧渲染,无 Electron,无 JS 桥。runtime 约 15 万行代码,整个 app 就是一个独立的 .exe。

Runtime
~150K LoC
Widgets
40+
Examples
10
License
MIT
核心能力

核心能力

原生渲染层 + 现代开发体感,全栈自洽

毛玻璃背景

D2D 1.1 高斯模糊 + tint,macOS Safari 同款视觉,硬件不支持时优雅降级。

Elevation 投影

5 档 box-shadow 语义投影,底层走 CLSID_D2D1Shadow 真高斯模糊。

媒体级 widget

VideoPlayer (MF + D2D) · AudioPlayer (WASAPI < 50ms) · WaveformView · Timeline · LevelMeter。

主题 + i18n

一行 Theme::set(...) / i18n::set_locale(...) 全应用切换,整树 rebuild 即生效。

Tick 动画

60 fps tick 循环,Widget::tick 返回 true 继续,false 停止,自由实现 count-up / ease / draw-in。

任意几何绘制

PaintContext: fill_rect / draw_bezier / fill_polygon / fill_ellipse / push_clip — 任何几何都能画。

Hello jtUI

Hello jtUI

从 widget 树到事件回调,一份 C++ 文件就跑起一扇硬件加速窗口

hello_jtui.cpp
#include "jtui/jtui.hpp"

int run_app() {
    jtui::Application app;

    jtui::WindowOptions options{};
    options.title     = "Hello jtUI";
    options.frameless = true;
    options.size      = {800.0F, 600.0F};
    jtui::Window& window = app.create_window(options);

    jtui::theme::Theme::set(jtui::theme::ThemeMode::Dark);

    auto root = std::make_unique<jtui::Panel>();
    root->set_role(jtui::PanelRole::Base);
    root->set_frame({0.0F, 0.0F, 800.0F, 600.0F});

    auto title = std::make_unique<jtui::Text>(u8"你好,jtUI");
    title->set_font_size(32.0F);
    title->set_bold(true);
    title->set_color(jtui::Color::from_hex("#FB923C"));
    title->set_alignment(jtui::TextAlignment::Center);
    title->set_frame({0.0F, 240.0F, 800.0F, 50.0F});
    root->append_child(std::move(title));

    auto cta = std::make_unique<jtui::Button>("Get started");
    cta->set_shape(jtui::ButtonShape::Pill);
    cta->set_frame({340.0F, 320.0F, 120.0F, 44.0F});
    cta->on_clicked().connect([]() { /* business callback */ });
    root->append_child(std::move(cta));

    window.set_content(std::move(root));
    return app.run();
}
40+ widget 开箱即用

40+ widget 开箱即用

basic · common · media 三大目录,覆盖布局到媒体的全部基本形态

basic6
  • Panel
  • Text
  • CodiconIcon
  • ScrollView
  • ListView
  • FlexBox
common24
  • Button
  • TextInput
  • Switch
  • Checkbox
  • Tabs
  • Dialog
  • Popover
  • Tooltip
  • Slider
  • Toolbar
  • Dropdown
  • SearchInput
  • ProgressBar
  • RadialGauge
  • SemiGauge
  • Gauge
  • Chip
  • Badge
  • Card
  • Avatar
  • FolderCard
  • MetricCard
  • SidebarNav
  • AboutCard
media5
  • VideoPlayer
  • AudioPlayer
  • WaveformView
  • Timeline
  • LevelMeter
10 个品牌 example

10 个品牌 example

每个 example 是一个完整品牌 hero 页,展示框架的不同能力

gallery组件库

Tab 切换的所有 widget + VSCode palette / codicons

jtui_hero品牌

双行大标题 + 内联 TextRun accent 高亮

jtui_cinema视频轮播

5 张几何缩略图 + ease 滑动 + VideoPlayer

jtui_studio媒体工作台

VideoPlayer + AudioPlayer + WaveformView 跨 rebuild 保活

jtui_invest金融落地

毛玻璃 NavBar + count-up 动画 + ScrollView

jtui_atlasKPI

sparkline + 图表卡片 + 网格背景

jtui_live编辑器

代码编辑器 mock + hot-reload 状态卡

jtui_pro企业 SSO

贝塞尔流线 + trust 徽章

jtui_pulse动态图表

自定义 clips_self() widget

folders_app文件管理

Sidebar nav + 文件夹网格 + search 筛选

开始使用 jtUI

项目处于预发布阶段,欢迎在 GitHub Issues 报 bug、分享使用场景、讨论设计。