项目
在 GitHub 查看
tessera-ui/tessera
关于
一个使用 Rust 编写、优先利用 GPU 的高性能 UI 框架,采用声明式和响应式设计。
网站与应用开发可以做什么
- Cross-platform: runs on Windows, macOS, Linux, Android, iOS and the web.
- Platform plugins: write a platform plugin to call APIs only one platform has.
- Reactive: no state notifications to keep in sync by hand.
- Bring your own shader: every effect is a pluggable shader, the built-in component library included.
实测星标增长
- 24小时
- 0
- 7天
- +1
- 15天
- +16
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
docs/README_zh-CN.md
原文特性
- 跨平台支持:支持 Windows、macOS、Linux、Android、iOS 和 Web。
- 平台插件:编写平台插件,调用平台特有的 API。
- 响应式:无需维护复杂的状态通知。
- 自定义着色器:用插件式着色器编写一切效果,内置组件库也不例外。
- 现代的脚手架:仅需
cargo-tessera便可完成一切操作。 - 纯粹的 Rust:纯粹的 Rust 语法,0% RSX。
如果您在使用过程中遇到任何问题,请随时提交 issue。
概览
use tessera_components::{
alignment::{CrossAxisAlignment, MainAxisAlignment},
column::column,
md3::{button::button, surface::surface, text::text, theme::material_theme},
};
use tessera_foundation::modifier::ModifierExt as _;
use tessera_ui::{Dp, Modifier, remember, tessera};
#[tessera]
pub fn app() {
let count = remember(|| 0i32);
material_theme().child(move || {
surface()
.modifier(Modifier::new().fill_max_size())
.child(move || {
column()
.modifier(Modifier::new().fill_max_size())
.main_axis_alignment(MainAxisAlignment::Center)
.cross_axis_alignment(CrossAxisAlignment::Center)
.children(move || {
text(count.get().to_string()).size(Dp(40.0));
button()
.filled()
.on_click(move || count.with_mut(|c| *c += 1))
.child(|| text("Increment"));
});
});
});
}
这就是一个完整的计数器应用程序!进一步的细节请参考快速开始指南。
创建项目
cargo install cargo-tessera
cargo tessera new my-app
cd my-app && cargo tessera dev
贡献
请参阅贡献指南,了解如何准备环境、运行检查和提交改动。
致谢
- wgpu,强大的图形 API 抽象层。
- winit,跨平台窗口和事件处理库。
- glyphon,文本渲染解决方案。
- 原始 Logo 设计由 @ktechhydle 完成。
许可证
Tessera 采用 MIT 许可证 或 Apache 2.0 许可证双重许可。
Star History
探索相关项目
加载中…