JFLib
EN

A complete GUI library in Rust.

Widgets, text, graphics, sound, networking and packaging in one no_std library with its own renderer. The same code runs on Windows, Linux, macOS, Android, iOS and in the browser.

Your own app, with Rust and Cargo
cargo install cargo-jflib
cargo jflib new hello
cd hello
cargo run
The JFLib widget gallery in the WinUI style: buttons, check boxes, sliders, text fields and a card. The same gallery in the macOS style. The same gallery in the KDE style. The same gallery in the Classic style with raised grey controls. The same gallery in the jfOffice style. The same gallery in the BackupCraft style with a petrol accent. The same gallery in the dark WinUI theme.
The Pocket Gallery, the same Rust widgets laid out for a phone.
Same app, different style

Starts inside this page. Nothing to install.

Ready80 crates7 styles9 languagesMIT or Apache 2.0

From the pixel to the installer, in one library.

An app describes its interface in one function and keeps its state in a plain Rust struct. JFLib handles layout, input, focus and rendering. Every block below is a real crate in the repository, with a safe API for your app.

Your appState in a struct, interface in App::frame
one small Rust program
LookPicked at build time
winuimacoskdeclassicjfofficebackupcraftnetlabOr Your Own
InterfaceWidgets, layout, input, focus
ui
Text and documentsShaping, spelling, pages
texttext_shapespelldoc_coredoc_iodoc_layoutdoc_viewpdfsheet_ioformatsdiagram_corediagram_iodiagram_view
GraphicsRenderer, effects, GPU
gfxfxsimdgpushaderwgslrender2ddxfrender3dgltf
ImagesBuilt-in codecs
img_coreimg_allimg_pngimg_jpegimg_webpimg_tiffimg_avifimg_av1img_jxlimg_jxl_encimg_jxrimg_jp2img_jbig2img_heifimg_hevcimg_gifimg_bmpimg_tgaimg_ddsimg_svgimg_pdn
GamesNew, the API may still change
gamegame_render3dphysicsgeomnetchan
Data and networkFiles, crypto, protocols, updates
netionetpktx509eapmcryptocompressarchivecasdatastoredatetimeupdate
AutomationAgents and scripts
agent_coreagent_io
PlatformWindows, Linux, macOS, Android, iOS, browser
platrtbase
WindowsLinuxmacOSAndroidiOSBrowser

unsafe stays inside the runtime, platform, SIMD, GPU and module layers.

--style winui,macos,kde,classic,jfoffice,backupcraft

Change the style. Keep the app.

Widgets are drawn by the selected style, so one interface can look like Windows, macOS, KDE or Office without touching your logic. Light and dark, accent colours and scaling change while the app runs. A small INI file lays your own colours, corners and spacing over any style.

Kritzel, a drawing app, in the WinUI style. The same Kritzel window in the Classic style. ClassicWinUI
JFBackup on Windows: a list of backup jobs with status badges and a navigation pane, in a dark theme, with demo data.
The Pocket Gallery on a phone.
--target win | linux | mac | android | ios | web

The same widgets everywhere.

Native windows, the browser host and the Android and iPhone hosts share the same Rust widgets and the same renderer.

  • WindowsNative app for x86-64 and ARM64 with desktop integration
  • LinuxNative app for x86-64 and ARM64, Wayland and X11, picked at startup
  • AndroidNative APK for Android 8 and later, with threads, network, files and printing
  • BrowserWebAssembly, tested on Chromium, Firefox and Safari
  • macOSNative app for Apple silicon and Intel Macs (macOS 13+): AppKit windows, menu bar, Dock, notifications; signed and notarized .dmg with self-updates
  • iOSNative iPhone and iPad app (iOS 16+): touch, Apple Pencil, keyboards, sensors, files
--target web

Whole apps in a browser tab.

Your app compiles to WebAssembly and keeps its widgets, its renderer and its screen reader support. The host picks a scalar, SIMD or threaded build based on what the browser can do.

GalleryKritzelJFPainterjfWord
The Feature Gallery running in a browser tab, with buttons, check boxes and sliders.
core + alloc

#![no_std]

No GUI framework underneath. Everything from one hand.

The renderer, the widgets, the image codecs, the network and the platform layer all live in this library, on top of Rust's core and alloc. You don't put a window crate, an event loop and a UI crate together, as egui apps do with eframe: one dependency, jflib, is the whole stack. Write your app no_std as well. When it needs a crate that uses std, one feature turns std on, and any crate links. Just don't add a second window loop or run an async runtime on the UI thread: JFLib already has both.

One app, one file

  • template3.81 MB
  • gallery4.23 MB
  • Kritzel4.37 MB
  • JFPainter8.75 MB
  • jfWord11.68 MB

Windows x86-64 release builds, measured on 2 November 2026.

Fast to change. Easy to check.

cargo jflib watch

Save a file and keep your place.

Hot reload rebuilds the app and brings it back where it was, with your change in it. Your session's input replays through the new code, so the widgets stay compiled Rust and your app needs no special state structure.

apps/hello/src/main.rs
- if ui.accent_button(100, "Click me") & EV_ACT != 0 {
+ if ui.accent_button(100, "Add one") & EV_ACT != 0 {
SaveBuildReplay inputSame place, new code
--inspect · Ctrl+Shift+I · F12

Point at any widget in a running app.

The overlay names the widget under the pointer with its id, label, size and state. A tool window adds the widget tree, properties, a script selector and frame statistics. Turned off, it costs nothing.

The inspector in detail

The live inspector naming each widget under the pointer with its id, label, size and state.
--script tests/smoke.uis

Tests that read like instructions.

A .uis script clicks, types, switches themes, checks the result and saves a screenshot, against the real app on Windows and Linux.

More about the test language

# a smoke test
click "Click me"
click "Click me"
expect text:"Clicks: 2" exists
click "Reset"
expect text:"Clicks: 0" exists
shot build/template.png
The script clicking the real app: the counter goes to two, then back to zero.
--contrast high · --text-scale 150

Works with a screen reader, a keyboard and big text.

A data view with charts, a grid and a wizard in the normal theme. The same data view in the high contrast theme. High contrastNormal
  • Screen readersUI Automation, AT-SPI2, VoiceOver on Mac and iPhone, an ARIA tree in the browser and Android's accessibility nodes.
  • System settingsHigh contrast, accent colour, reduced motion and a text size separate from the UI scale.
  • KeyboardFull operation with focus groups, F6 through panes and the menu key everywhere.
  • MagnifiersThe caret position is reported so a screen magnifier can follow it.
The widget gallery with text at 150 percent while the icons keep their size.
Text at 150 %. Icons keep their size.
lib/gpu · lib/wgsl

Direct access to the graphics card.

For programs that need more than an interface: compute shaders, rendering with a depth test, indirect draws, timestamps and window swapchains, behind an explicit API in the style of Vulkan and WebGPU.

  • WindowsVulkanAvailable
  • LinuxVulkanAvailable
  • AndroidVulkanAvailable
  • BrowserWebGPUAvailable
  • AppleMetalAvailable
Thousands of coloured cubes in motion, rendered by the GPU layer.
JFLib's GPU test scene with 200,000 moving cubes.
  1. WGSL shaderYour shader source
  2. wgslChecks it and compiles it to SPIR-V for Vulkan and MSL for Metal; the browser takes WGSL as it is
  3. gpuDevices, queues, pipelines and command buffers, with the back end picked at build time
  4. Your windowThe widgets still rasterize on the CPU. On Windows, Linux, Android and in the browser the GPU takes over output, layers, images and canvases; on Mac and iPhone that is still off by default.
--agent-mcp

Designed to be used by AI agents.

JFLib is written for agents first, so the whole code base is optimized for hardware efficiency. An agent can build an app, run it and check the result by itself.

See

PNG screenshots without a visible window, and dumps of the widget tree.

--shot target/app.png
--size 1000x800

Act

Scripts, or JSON-RPC and MCP over standard input and output.

--script tests/smoke.uis
--agent-json
--agent-mcp

Check

Every new app starts with a test that already passes.

expect text:"Clicks: 2" exists
cargo jflib test

No language model runs inside your app. The agent endpoint stays closed until the app is started with --agent, --agent-json or --agent-mcp.

All the parts of a real app.

Buttons Check boxes Switches Text fields Sliders Lists Tabs Menus Dialogs Scroll areas Toolbars Office ribbons Grid box Docking panels Tool windows Popups Tooltips Virtual grids Trees Navigation panes Command bars Splitters Wizards Charts Toasts Date and time inputs Diagram canvas Terminal Rich-text editor Code editor Image viewer Font dialog

KPI cards with sparklines, a stacked bar chart, a donut chart, a sortable grid, a wizard and a toast.
Charts and data viewsKPI cards, sparklines, stacked bars, donuts, a sortable grid, wizards and toasts.
A node dragged across a diagram, with its edges following and the minimap updating.
Diagram canvasNodes, ports, three kinds of edges, grid snapping and a minimap.
The code editor showing Rust with syntax highlighting in the dark theme.
Code editorRust, JSON, INI, TOML and Markdown. Stays fast with 100,000 lines.
The rich-text editor with headings, character formats, lists, a quotation and alignments.
Rich-text editorHeadings, character formats, lists, quotations and alignments, with HTML in and out.
An Office ribbon with font, paragraph and style groups, from jfWord.
Office ribbonsTabs, groups and galleries, as used by jfWord.
A panel dragged over docking markers and dropped into a tab group.
DockingTab groups, drop markers, floating tool windows and saved layouts.
An item dragged from a shelf into a basket that lights up.
Drag and dropBetween widgets, and to and from other programs.
SVG test pictures with shapes, paths, strokes, gradients, transforms and clip paths.
SVGJFLib's own rasterizer, sharp at every size.
A misspelled word with suggestions in its context menu.
Spell checkingHunspell dictionaries or the Windows spell checker.
The font dialog with a search field, styles, sizes and a preview.
Font dialogSearches the installed fonts and previews the choice.
The terminal widget with a router prompt.
TerminalA terminal widget, drawn by every style.

Text and fonts

OpenType shaping, bidirectional text, font fallback, hyphenation, subpixel smoothing and input methods on Windows, Wayland and X11.

Languages

Plural rules, regional formats, sorting and mirrored layouts.

DeutschEnglishFrançaisEspañolItalianoNederlandsPolskiالعربيةעברית

Images

Built-in codecs including PNG, JPEG, WebP, TIFF, AVIF and JPEG XL, an image viewer with zoom and pan, and SVG icons.

Sound

Output streams with a target latency over WASAPI, PipeWire, WebAudio and AAudio, mixed WAV and Ogg Vorbis sounds and the system's own sounds.

Desktop integration

Notifications, a tray icon, taskbar progress, jump lists, file types, global shortcuts, a screen colour picker and drag and drop with other programs.

Files and permissions

One file namespace with app://, config:// and mem://, assets inside the program, a PERMISSIONS manifest enforced at run time and the system's secret store.

Updates and packages

Signed updates with rollback, code signing, and packages from a Windows setup and .deb to AppImage, Flatpak, MSIX and RPM.

Network and security

HTTP, WebSocket, TLS 1.3 with certificates from Let's Encrypt, SMTP, an SSH client and DNS, modern cryptography, LZ4 and zstd, a journal database and encrypted repositories.

App framework

Logging, lifecycle hooks, typed settings with a generated settings page, saved window state and async tasks in the event loop.

PDF, tables and drawings

Write, read and change PDF files, forms included. Excel workbooks and CSV in and out, DXF drawings and Visio files.

2D for CAD and 3D

Large drawings with snapping and exact coordinates, also without a GPU, and a 3D engine with glTF models between the widgets.

Games

A game core with a fixed tick, gamepads, physics, modelling and multiplayer. New in 0.2.2.

Apps built with JFLib.

JFNetworker, JFPainter and JFBackup have their own sites on jfreund.org.

JFNetworker with a campus network of a switch, a router, a server and four PCs on a grid.

JFNetworker

A network simulator and lab: build networks, set up every device in its console and follow every packet. With an academy and a lab for distributed systems.

Product page
JFPainter with the JFLib sample drawing open.

JFPainter

An image editor with layers, brushes, effects, many image formats and plugins. On the desktop, in the browser and, as an experiment, on Android.

Product page
JFBackup, still named BackupCraft in its title bar: a list of backup jobs with status badges and a navigation pane, with demo data.

JFBackup

A backup suite with its own server and agents: deduplicated, encrypted and signed backups, schedules, replication and restore.

Product page
jfWord with its ribbon, a navigation pane and a document.

jfWord

A word processor with a ribbon, page view, text styles, tables, references and DOCX support.

Product page coming soon
Kritzel with the JFLib sample drawing.

Kritzel

A drawing app with brushes, shapes, text, selections and layers.

Product page coming soon
The Build Manager with an app list and build settings.

Build Manager

A graphical build app for applications, styles, profiles, tests and release packages.

Product page coming soon
cargo jflib new hello

A complete app fits on one screen.

// src/lib.rs
#![no_std]
#![deny(unsafe_code)]

extern crate alloc;
use jflib::{style, ui};
use ui::*;

const DESC: AppDesc = AppDesc {
    title: "Hello JFLIB",
    flags: AF_RESIZABLE,
    w: 480,
    h: 300,
    min_w: 320,
    min_h: 240,
    ..AppDesc::NONE
};

#[derive(Default)]
struct Counter {
    clicks: u32,
}

impl App for Counter {
    fn frame(&mut self, ui: &mut Ui) {
        ui.box_begin(0, BOX_V | pad(24), 12);
        ui.text(TS_TITLE, "Hello JFLIB!");
        ui.text(TS_BODY, &alloc::format!("Clicks: {}", self.clicks));
        if ui.accent_button(100, "Click me") & EV_ACT != 0 {
            self.clicks += 1;
        }
        if ui.button(101, "Reset") & EV_ACT != 0 {
            self.clicks = 0;
        }
        ui.box_end();
    }
}

ui::main!(ui::launch(&DESC, Counter::default(), &style::STYLE));
A window with a click counter, an accent button and a reset button.
cargo install cargo-jflib
cargo jflib new hello
cd hello
cargo run
cargo jflib test

You need Rust through rustup. The new app is a normal Cargo project with one dependency, jflib, and comes with its permissions, package data and a smoke test.