Components
Rust & GPUI

Make it your own.

为桌面应用设计的 GPUI 组件,从 Accordion 开始。
从预览到源码,把细腻的交互带进你的项目。

01. Explore the interaction

打开组件页面,在 Preview 中体验展开、收起和键盘导航,试试不同模式与明暗主题。网页通过 WASM 运行 GPUI,与桌面端共用同一份 Rust 组件源码。

02. Run it on your desktop

下载完整示例并解压。安装 Rust 后,在示例目录运行下方命令;rustup 会按照项目中的 rust-toolchain.toml 使用指定工具链。首次构建会下载依赖。

Download Rust examples
Terminal
# From the extracted example directory:cargo run --locked -- --accordion# Or explore another demo:cargo run --locked -- --accordion card

Accordion 还提供 multiple、disabled、card 三个演示。替换命令最后的名称即可体验。

03. Make the details yours

组件页面的 Code 展示实际 Rust 实现,Usage 给出接入方式。保留组件实体,将点击回调或选中状态连接到你的应用,再按需要调整文案、颜色与布局。完整示例包含所需字体和图形资源,方便一起迁入项目。

Start with a small interaction.

从 Accordion 的第一段展开开始。

Explore Accordion