Skip to content

About

Rust GUI framework on GPUI with ribbon-centric Fluent 2 design (Apache-2.0)

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

6 stars

Watchers

2 watching

Forks

fluent-gpui

CI Latest release Licence: Apache-2.0

A Fluent 2 design system for native Windows and Linux desktop apps, built on GPUI, the GPU UI framework from Zed.

The fluent-gpui component gallery with the Fluent title bar, a navigation sidebar and a page of controls

What is it

fluent-gpui gives GPUI applications a complete, themed set of desktop controls and application chrome in the style of Fluent 2: buttons, inputs, menus, dialogs, trees, data tables, a ribbon command bar and a custom title bar. You write ordinary GPUI views; the fluent-* crates supply the look, the tokens and the behaviour. It is aimed at productivity-style desktop apps, not at the web.

Highlights

  • Fluent 2 look on GPUI. Light, dark, high-contrast and right-to-left variants of every control, driven by design tokens in fluent-core.
  • Ribbon-centric layout. A ribbon with tabs, groups, contextual tabs and overflow, plus dock panels, panes and splits, a command palette, context menus, a tree and a data table.
  • A frameless Fluent window. FluentApp opens a window with the Fluent title bar, resize chrome, theme, modal and toast hosts and bundled assets.
  • Keyboard and accessibility. Visible focus, a keyboard path for every action, and roles, names and actions exposed through AccessKit (UI Automation on Windows, AT-SPI on Linux).
  • Test utilities. fluent-test-utils dumps the accessibility tree and helps write in-process UI tests.
  • Native integration surfaces. A video surface, a terminal grid and view, and file pickers, with documented contracts.
  • A vendored GPUI. A filtered snapshot of upstream Zed main is vendored, so every release builds against one known GPUI.

Install

fluent-gpui is distributed by git tag. The latest release is v4.0.0+zed.ba63a022c9a2 (the part after +zed. is the Zed commit the vendored GPUI was cut from). Pin one exact tag on every fluent-* crate you use:

[dependencies]
fluent-core       = { git = "https://github.com/thedancingdeveloper/fluent-gpui", tag = "v4.0.0+zed.ba63a022c9a2" }
fluent-primitives = { git = "https://github.com/thedancingdeveloper/fluent-gpui", tag = "v4.0.0+zed.ba63a022c9a2" }
fluent-app        = { git = "https://github.com/thedancingdeveloper/fluent-gpui", tag = "v4.0.0+zed.ba63a022c9a2" }

[dev-dependencies]
fluent-test-utils = { git = "https://github.com/thedancingdeveloper/fluent-gpui", tag = "v4.0.0+zed.ba63a022c9a2" }

Not on crates.io (for 4.x). The names fluent-core, fluent-app, fluent-primitives, fluent-layout and fluent-ribbon exist on crates.io, but they are an older 2.x line that does not match this repository. Use the git tags.

Build requirements, the Linux packages and feature flags are in docs/architecture.md. On Debian or Ubuntu:

sudo apt-get install libxcb1-dev libxkbcommon-dev libxkbcommon-x11-dev libfontconfig-dev libwayland-dev libvulkan-dev

Quick start

A window with the Fluent title bar and a counter. This is examples/hello_world:

use fluent_app::FluentApp;
use fluent_core::gpui::{div, prelude::*, px, ClickEvent, Context, IntoElement, Render, Window};
use fluent_core::ThemeProvider as _;
use fluent_primitives::{Button, ButtonAppearance, Label, LabelSize};

struct Counter {
    count: u32,
}

impl Render for Counter {
    fn render(&mut self, _window: &mut Window, cx: &mut Context<Self>) -> impl IntoElement {
        let colors = cx.theme().colors.clone();
        div()
            .size_full()
            .flex()
            .flex_col()
            .items_center()
            .justify_center()
            .gap(px(24.0))
            .bg(colors.surface)
            .child(Label::new(format!("Count: {}", self.count)).size(LabelSize::Display))
            .child(
                div()
                    .flex()
                    .flex_row()
                    .gap(px(8.0))
                    .child(
                        Button::new("increment")
                            .label("Increment")
                            .appearance(ButtonAppearance::Accent)
                            .on_click(cx.listener(|this, _: &ClickEvent, _, cx| {
                                this.count += 1;
                                cx.notify();
                            })),
                    )
                    .child(Button::new("reset").label("Reset").on_click(cx.listener(
                        |this, _: &ClickEvent, _, cx| {
                            this.count = 0;
                            cx.notify();
                        },
                    ))),
            )
    }
}

fn main() {
    FluentApp::new("Hello FluentGUI")
        .window_size(480.0, 320.0)
        .run(|cx| cx.new(|_| Counter { count: 0 }));
}

FluentApp::run installs the theme, the modal and toast hosts and the window title, opens a frameless window with the Fluent title bar and resize chrome, and loads the bundled assets. Apps use GPUI through fluent_core::gpui, so they never depend on gpui directly. For forms, a ribbon and a data table, read the quick start guide.

Examples

Clone the repository and run any example with Cargo:

Command What it shows
cargo run -p hello_world The smallest app, as above
cargo run -p gallery Every control, by component family, with light, dark, high-contrast and RTL variants (guide)
cargo run -p widgets A set of widgets in one window
cargo run -p form A form built from Field and input controls
cargo run -p demo_app A project-tracker style app with a ribbon, settings navigation and a data table
cargo run -p screenshots -- <component> One component in a small window, used by the screenshots harness

Screenshots

Every image on this page is a real render of the gallery or of one component, captured headlessly under Xvfb at 1000x600 (components) or 1280x800 (gallery).

Component gallery

Buttons and toggles

DarkLight
Button (dark theme) Button (light theme)
Icon button (dark theme) Icon button (light theme)
Toggle button (dark theme) Toggle button (light theme)
Switch (dark theme) Switch (light theme)

Selection and text input

DarkLight
Checkbox (dark theme) Checkbox (light theme)
Radio group (dark theme) Radio group (light theme)
Combobox (dark theme) Combobox (light theme)
Dropdown (dark theme) Dropdown (light theme)
Text input (dark theme) Text input (light theme)
Textarea (dark theme) Textarea (light theme)
Search box (dark theme) Search box (light theme)
Token input (dark theme) Token input (light theme)
Date and time picker (dark theme) Date and time picker (light theme)
Field (dark theme) Field (light theme)

Status and feedback

DarkLight
Badge (dark theme) Badge (light theme)
Message bar (dark theme) Message bar (light theme)
Progress bar (dark theme) Progress bar (light theme)
Spinner (dark theme) Spinner (light theme)
Skeleton (dark theme) Skeleton (light theme)
Toast (dark theme) Toast (light theme)
Tooltip (dark theme) Tooltip (light theme)

Layout and navigation

DarkLight
Ribbon (dark theme) Ribbon (light theme)
Tab strip (dark theme) Tab strip (light theme)
Tree (dark theme) Tree (light theme)
Settings navigation (dark theme) Settings navigation (light theme)
Toolbar (dark theme) Toolbar (light theme)
Title bar (dark theme) Title bar (light theme)

Overlays and menus

DarkLight
Dialog (dark theme) Dialog (light theme)
Flyout (dark theme) Flyout (light theme)
Popover (dark theme) Popover (light theme)
Context menu (dark theme) Context menu (light theme)
Command palette (dark theme) Command palette (light theme)

Data

DarkLight
Data table (dark theme) Data table (light theme)
Selectable list (dark theme) Selectable list (light theme)
Card (dark theme) Card (light theme)
Avatar (dark theme) Avatar (light theme)

Whole-gallery pages

The gallery's pages, one per component family, in dark and light.

Show all 12 gallery pages
DarkLight
Gallery page: Buttons and links (dark theme) Gallery page: Buttons and links (light theme)
Gallery page: Selection (dark theme) Gallery page: Selection (light theme)
Gallery page: Text (dark theme) Gallery page: Text (light theme)
Gallery page: Status and feedback (dark theme) Gallery page: Status and feedback (light theme)
Gallery page: Data and lists (dark theme) Gallery page: Data and lists (light theme)
Gallery page: Data display (dark theme) Gallery page: Data display (light theme)
Gallery page: Date and input (dark theme) Gallery page: Date and input (light theme)
Gallery page: Layout (dark theme) Gallery page: Layout (light theme)
Gallery page: Media (dark theme) Gallery page: Media (light theme)
Gallery page: Menus (dark theme) Gallery page: Menus (light theme)
Gallery page: Overlays (dark theme) Gallery page: Overlays (light theme)
Gallery page: Theme and direction (dark theme) Gallery page: Theme and direction (light theme)

Keyboard focus

Each image is the component after a real Tab key press, showing its focus ring (dark theme on top, light below).

Button with keyboard focus (dark theme) Text input with keyboard focus (dark theme) Tab strip with keyboard focus (dark theme)
Tree with keyboard focus (dark theme) Data table with keyboard focus (dark theme) Dropdown with keyboard focus (dark theme)
Button with keyboard focus (light theme) Text input with keyboard focus (light theme) Tab strip with keyboard focus (light theme)
Tree with keyboard focus (light theme) Data table with keyboard focus (light theme) Dropdown with keyboard focus (light theme)

Crates

Crate What it provides
fluent-core Theme, design tokens, colours, typography, motion, and the fluent_core::gpui re-export
fluent-primitives Buttons, inputs, dropdowns, checkboxes, switches, badges, cards, tooltips, expander, scrollbar, date and time picker, input capture, video surface, terminal view
fluent-layout Menus, context menus, toolbar with overflow, dock panels, panes and splits, tree, data table, dialogs, toasts, command palette
fluent-ribbon The ribbon command bar: tabs, groups, contextual tabs, overflow
fluent-app FluentApp, the title bar, client-side window chrome, bundled assets, file pickers
fluent-test-utils Accessibility tree dumps and UI test helpers (use as a dev-dependency)

Platform support and status

Platform Renderer Accessibility Status
Windows 10/11 x64 DirectX 11 UI Automation Supported
Linux x64, X11 and Wayland wgpu (Vulkan, GL fallback) AT-SPI Supported
macOS, web / wasm Not a target

fluent-gpui is at version 4.x. Parts of it have had limited runtime validation. Plainly:

  • Everything is built and tested on Windows and Linux in CI, including in-process GPUI tests. Screenshots are captured headlessly on Linux.
  • On Linux the example apps have been launched under a headless Wayland compositor with software rendering. Runs on real GPU hardware and on a full X11 desktop session are still outstanding.
  • On Windows the examples launch and the window states (minimise, maximise, restore, move, resize) behave on a real desktop. Rendered output could not be captured automatically, and pointer snap gestures and DirectX device-loss recovery have not been exercised.
  • The video surface and backdrop blur are applied on both platforms but not yet validated at runtime. Without the backdrop-blur feature, blur surfaces fall back to a solid tinted fill.
  • Screen reader testing is not yet part of the published validation record.

Details and the full list of known gaps: docs/maintainers/status.md.

Keyboard and accessibility

Every control is reachable and operable from the keyboard: Tab and Shift+Tab move focus, with a visible focus ring; Enter and Space activate; arrow keys, Home/End and PageUp/PageDown move within lists, trees, tables and menus; Escape closes popups; dialogs trap focus. Each control exposes a role, an accessible name and its actions through AccessKit. The component index lists the keyboard contract of every component, and fluent-test-utils lets you test your own app's accessibility tree.

Documentation

The full list is in docs/README.md. Start with:

Upgrading

The 4.0.0 release changes row and chrome sizes and a few signatures. The migration steps are in the 4.0.0 section of the changelog. It also adds Scrollbar, a Toolbar "More" menu, Button::loading, an .error(bool) state on text-like inputs, window position save and restore, and RowDensity.

Contributing, security and licence

Trademarks and affiliation

fluent-gpui is an independent project. It is not affiliated with, endorsed by or sponsored by Microsoft. "Fluent" refers to the publicly documented Fluent 2 design language; no Microsoft fonts or Office artwork are included. It is built on GPUI from Zed, which is licensed under Apache-2.0. Zed and GPUI belong to their respective owners.

About

Rust GUI framework on GPUI with ribbon-centric Fluent 2 design (Apache-2.0)

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

6 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages