JFLib
EN

Interface

What people see and touch in your app.

Widgets and layout

An app describes its interface in one function. JFLib handles layout, input, focus and drawing.

The widget gallery with buttons, check boxes, sliders, text fields and a card.
A panel dragged over docking markers and dropped into a tab group.
Buttons
Standard, accent, icon and split buttons.
Choices
Check boxes, radio buttons and switches.
Values
Sliders and progress bars.
Text input
Text fields, password fields and number boxes.
Lists and tabs
Lists, tabs and scroll areas.
Menus and dialogs
Menus, context menus and dialogs.
Toolbars and ribbons
Plain toolbars and full Office ribbons, with key tips and a backstage.
Grid box
Lay widgets out in rows and columns.
Docking
Panels in tab groups and floating tool windows, with drop markers while dragging. The layout is kept.
Popups and tooltips
They may leave the window, like native ones.
Scaling
Sizes are device-independent, so an interface stays sharp on every display.

Data views and app shells

The parts a real business app is made of, drawn by every style.

A data view with KPI cards, charts, a sortable grid, a wizard and a tree.
A node dragged across a diagram, with its edges following and the minimap updating.
The terminal widget with a router prompt.
Virtual grids
Large tables with sorting and multiple selection.
Trees
Nested data, also with check boxes.
Navigation panes
The side menu of a modern app, with groups and badges.
Command bars and splitters
The frame around your content.
Wizards
Step-by-step flows with a visible position.
Charts
KPI cards with sparklines, line charts, stacked bars and donuts.
Toasts
Short messages that do not interrupt.
Date and time inputs
Ready-made fields for dates and times.
Diagram canvas
Nodes, ports, straight, curved and right-angled edges, grid snapping and a minimap.
Shape editing
Move, resize and turn shapes on the canvas, draw connectors, snap to guides, with rulers at the edge.
Terminal
A terminal widget for consoles and logs.

Editors

Finished editors you can place in your app like any other widget.

The rich-text editor with headings, formats and lists.
The code editor with Rust and syntax highlighting.
The Markdown viewer with headings, lists, a quotation and code.
Rich-text editor
A formatting toolbar, headings, character formats, colours, fonts, lists and quotations, with HTML in and out.
Code editor
Highlighting for Rust, JSON, INI, TOML and Markdown, line numbers, find and replace. Stays fast with 100,000 lines.
Markdown and HTML viewer
Shows documents with selection, links, images, tables and code blocks.
Undo history
Undo and redo for your app's own documents.

Look and text

How your app appears, reads and adapts to the person using it.

Styles and themes

The style draws the widgets, so one interface can take on a different look without changing your logic.

The gallery in WinUI.
WinUI
The gallery in macOS.
macOS
The gallery in KDE.
KDE
The gallery in Classic.
Classic
The gallery in jfOffice.
jfOffice
The gallery in BackupCraft.
BackupCraft
Ready-made styles
WinUI, macOS, KDE, Classic, jfOffice, BackupCraft and netlab.
Independent of the system
The macOS style can run in a Windows app.
Change while running
Light and dark, accent colours and scaling switch at run time. An app that links several styles can switch between them too.
Your own theme
A small INI file sets colours, corner radii, spacing, control heights and type, over any style.
Your own style
A documented contract for writing a new style.

Text and fonts

Text that works for real documents and real languages.

A misspelled word with suggestions in a context menu.
The font dialog with search, styles, sizes and a preview.
OpenType shaping
Complex scripts, ligatures and bidirectional text.
Font fallback
Missing glyphs come from other fonts, with font aliases and fonts per language.
Font picker and dialog
Search the installed fonts and preview the choice.
Line breaking
Unicode grapheme, word and line segmentation, and hyphenation.
Subpixel smoothing
Sharp text on ordinary displays.
Spell checking
Hunspell dictionaries or the Windows spell checker, with suggestions and a personal dictionary.
Input methods
On Windows, Wayland and X11.

Languages and regions

Dialogs and messages from the library are already translated.

The gallery set to Arabic: the whole layout is mirrored, with the menu and the sliders running from the right.
Set to Arabic, the whole window mirrors. The library's own texts are translated, and this demo's texts fall back to English.
Nine languages
DeutschEnglishFrançaisEspañolItalianoNederlandsPolskiالعربيةעברית
Right to left
Layouts mirror for right-to-left languages.
Plural rules
Correct forms for every supported language.
Regional formats
Numbers and dates the way each region writes them.
Sorting
Lists sort by the rules of the language.

Accessibility

Follows the system's settings by default.

A data view in the high contrast theme.
The gallery with text at 150 percent while icons keep their size.
Screen readers
UI Automation on Windows, AT-SPI2 on Linux, VoiceOver on Mac and iPhone, an ARIA tree in the browser and accessibility nodes on Android.
High contrast
A high contrast theme that follows the system.
Text size
A text scale separate from the UI scale. Icons keep their size.
Accent colour and reduced motion
Taken from the system.
Full keyboard operation
Focus groups, F6 through panes and the menu key everywhere.
Screen magnifiers
The caret position is reported so a magnifier can follow it.

System

Everything an app needs beyond its window.

Desktop integration

Your app behaves like it belongs on the desktop.

An item dragged from a shelf into a basket that lights up.
Drag and drop
Text, HTML, URLs, images and files, between widgets and to and from other programs.
Notifications and tray icon
System notifications and a notification-area icon.
Taskbar
Progress, badges and jump lists.
File types and URL schemes
Your app opens its own files and links.
One instance per app
A second start reaches the running app.
Start at login, stay awake
Start with the session and keep the system awake when needed.
Monitors
The monitor list with work areas, DPI and refresh rates.
Global shortcuts
Keys that work while your app is in the background.
Screen tools
Pick a colour anywhere on the screen and take pictures of the screen.
Share sheet
Hand text, links and files to other apps, on Windows, Mac, iPhone, Android and in the browser.
Touchpads and wheels
Touchpads scroll by the pixel, and the wheel by as many lines as the system says.

Sound

One interface on Windows, Linux, Android and in the browser. There is no sound on Mac and iPhone yet.

The audio test app with a tone generator, sounds to play and system sounds.
Output streams
With a target latency, over WASAPI, the PulseAudio protocol that PipeWire serves, WebAudio and AAudio.
Short sounds
WAV and Ogg Vorbis files, mixed together.
System sounds
The system's own sounds for events and message dialogs.

Files and permissions

An app states what it may do, and the library enforces it.

# PERMISSIONS, next to your app's sources
fs.read   $EXE/templates/**
fs.write  $CONFIG/MyTool/**
fs.user
url       https mailto
net.connect api.example.com:443
ask fs.read $DOCUMENTS/** "Open letters"
ask print

Everything else is refused. Lines with ask show a question at the first access, with your reason.

One file namespace
app://, config://, data://, cache:// and mem://, ZIP archives and overlays.
Assets inside the program
Your files travel with the app.
Permission manifest
Each app lists its files, programs, URLs and more. It is enforced at run time, with questions to the user.
Secret store
Passwords and keys go into the system's secret store.

Updates and packages

From the finished build to the installed app.

Windows setup.debRPMAppImageFlatpakMSIX.dmgAPK
Signed updates
Updates are signed, with rollback if something goes wrong.
Code signing
Part of the release path.
Packages
Built from one description of your app.

Images and documents

Open and save common formats without an extra library.

jfWord with a document, a ribbon and a navigation pane.
Built-in image codecs
Including PNG, JPEG, WebP, TIFF, AVIF, JPEG XL and JPEG 2000.
Document components
Shared document, layout and DOCX parts, as used by jfWord.
PDF
Write vector PDFs with text, links and bookmarks. Read and show existing files, fill in their forms and save the change.
Tables
Excel workbooks and CSV files, in and out as typed rows.
Drawings and diagrams
DXF drawings from R12 to 2018, and Visio files in and out.
JSON, XML and encodings
Strict readers with limits, also for files from strangers.

Network and security

Written for JFBackup and usable by any program.

HTTP/1.1TLS 1.3TLS 1.2 clientX.509ACMEOCSPWebSocketSMTPSSH-2 clientDNSDNSSECDoTDoHBLAKE3Argon2idChaCha20-Poly1305AES-GCMX25519ML-KEMEd25519RSAECDSALZ4zstdpcapng
Server and client
An HTTP server and client, TLS with private CAs and the system's trust store, mail, SSH and DNS.
Certificates
From Let's Encrypt and other ACME authorities, with OCSP. TLS 1.3 takes the post-quantum key exchange X25519MLKEM768.
Cryptography and compression
Modern algorithms and fast compression, in the library itself.
Storage
An embedded journal database and deduplicating, encrypted repositories.
Packets
Codecs from Ethernet to TCP, a dissector and pcapng files, for simulators and tools.

Development

Fast to change and easy to check, for people and for agents.

Developer tools

See what your app does while it runs, and keep checking it.

The live inspector naming each widget under the pointer.
The Build Manager with an app list and build settings.
Hot reload
Save a file, and the app rebuilds and comes back where it was with your change in it.
Live inspector
Point at a widget to see its id, label, size and state, with a widget tree, properties and frame statistics.
.uis test scripts
Readable scripts that click, type, check and take screenshots in the real app.
Screenshots without a window
Any app renders straight to a PNG.
Widget dumps
The state of the interface as text.
New app in one command
cargo jflib new writes a Cargo project with permissions, package data and a passing test.
Build Manager
A graphical app for builds, profiles, tests and release packages.

AI agents

JFLib is designed to be used by AI agents, so an agent can build an app, run it and check the result by itself.

# see
--shot target/app.png --size 1000x800
# act
--script tests/smoke.uis
--agent-json
--agent-mcp
# check
cargo jflib test
See
Screenshots and widget dumps show an agent what is on screen.
Act
Scripts, or JSON-RPC and MCP over standard input and output.
Check
Expectations in scripts and a test command for every app.
Off by default
No language model runs inside your app, and the endpoint stays closed until you switch it on at startup.

Foundation

What the library runs on, and how it is built.

Platforms

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

The gallery running in a browser tab.
The gallery in a browser tab, as WebAssembly.
Windows
Native app for x86-64 and ARM64 with desktop integration.
Linux
Native app for x86-64 and ARM64, on Wayland or X11, picked at startup.
Android
Native APK for Android 8 and later. Threads, network, files, printing and the system's fonts work as on the desktop. The Pocket Gallery and jfWord run on it.
Browser
WebAssembly with scalar, SIMD and threaded builds, tested on Chromium, Firefox and Safari. Native plugins and system services are more limited here.
macOS
Native app for Apple silicon and Intel Macs, macOS 13 and later: AppKit windows, the menu bar, Dock and notifications. Packed as a signed and notarized .dmg, with updates of the whole app.
iOS
Native iPhone and iPad app for iOS 16 and later, with touch, Apple Pencil, keyboards, sensors and files. Built on a Mac.

GPU

Direct access to the graphics card, for programs that need more than an interface.

Thousands of coloured cubes in motion, rendered by the GPU layer.
The GPU test scene with 200,000 moving cubes.
Explicit API
Compute shaders, rendering with a depth test, indirect draws, timestamps and swapchains, in the style of Vulkan and WebGPU.
WGSL shaders
Checked and compiled to SPIR-V and MSL by the library itself; the browser takes them as they are.
Available today
Vulkan on Windows, Linux and Android, WebGPU in the browser, Metal on Mac and iPhone (the full level from A14/M1). The widgets still rasterize on the CPU, and the GPU takes over output, layers, images and canvases (on Mac and iPhone once switched on).
Planned
A Direct3D 12 fallback on Windows, and the widgets drawn on the GPU.

3D, CAD and games

Engines on top of the GPU layer, for drawings, scenes and games inside a normal app.

render3dgltfrender2ddxfgamephysicsgeomnetchan
3D engine
Scenes, physically based materials, light and shadows, and glTF models, shown in a view between the widgets.
2D for CAD
Lines, arcs, curves, fills, hatches, text and blocks, exact at large coordinates. It also draws without a GPU.
Selecting and snapping
Pick, highlight and snap to end points, centres and crossings.
Game core
Entities, a fixed tick, input actions, gamepads and cameras.
Physics
Collision, rigid bodies and a character controller, with the same bits on every platform.
Modelling
Meshes from primitives, profiles and Boolean operations, with checks.
Multiplayer
A server that decides, prediction, rooms and message channels over UDP and WebSocket.
Still young
The game crates are new in 0.2.2, and their API may still change.

Foundation

How the library itself is put together.

#![no_std]
#![deny(unsafe_code)]

extern crate alloc;
use jflib::{style, ui};
use ui::*;
no_std
The library uses core and alloc. Apps are best no_std too.
std when you need it
features = ["std"] lets an app use any std crate. Crash reports stay JFLib's; PERMISSIONS then covers JFLib's own calls, the sandbox line all code.
From one hand
Windows, input, widgets, files, network, threads and async tasks come from one library. A second window loop (winit, eframe) or tokio on the UI thread fights JFLib's own.
Modular
80 crates with safe APIs for your app.
Contained unsafe
It stays inside the runtime, platform, SIMD, GPU and module layers.
Open licences
MIT or Apache 2.0, at your option.