Released6 Nov 2026Commit1268169dLine0.1.xLateston its line

v0.1.0

sigil-ui 0.1.0

Files at this release
Notes

I've been building sigil-ui to draw the screens a system needs before there's a desktop: a boot menu, a progress display, a log you can follow while services start. The same library can draw into an ordinary Wayland window or save a frame to a PNG file.

This is its first release! It's a small retained-mode UI library for Sigil, with a software renderer. You describe a screen with a function of your application state. When the state changes, you call that function again; sigil-ui compares the new tree with the one it kept and repaints the damaged rectangles. Keys preserve a child's identity when you reorder a list, and components let you skip a subtree whose input hasn't changed.

Drawing a first frame

Here's the drawing code for a progress bar. It makes a 320 by 80 canvas, fills half of the bar, and writes progress.png:

(import (sigil math)
        (sigil ui raster)
        (sigil ui theme)
        (sigil ui tree)
        (sigil ui png))

(define theme
  (make-theme
    (list (cons 'background #x101820)
          (cons 'accent #xEDBB45))
    '()
    '()))

(define ui
  (make-ui theme (make-canvas 320 80) 1 'background))

(define (view progress)
  (group 0 0
    (list (rect 20 30 (quotient (* 280 progress) 100) 20 'accent))))

(ui-update! ui (view 50))
(write-png! "progress.png" (ui-canvas ui))

Put the drawing code in your program's entry procedure after the imports. To change the bar, call ui-update! with the next percentage. It returns the rectangles that changed, in logical pixels, for your presentation code to use.

What's in the box

You can draw solid or blended rectangles, bitmap text, colored text runs and alpha masks. Themes give names to colors, font sets and images. Fonts and masks can have a separate asset for each integer scale, so the view keeps the same logical coordinates.

There are offscreen buffers, Linux fbdev and DRM surfaces, and Wayland windows and fullscreen surfaces. The DRM API supports releasing display ownership and preserving the last frame during handoff on Linux 6.8 or later. Wayland reports keyboard and pointer events, resize and scale changes, and presents pixel damage through shared-memory buffers. The demo shows how to drive that event loop.

The pixel loops, device access and PNG encoder are C. The tree, reconciliation and display list are Sigil. Offscreen rendering needs no external graphics library; Wayland loads libwayland-client and libxkbcommon at runtime and needs a dynamically linked program.

What you'll still build yourself

The native package currently targets Linux. You build the widgets around these primitives: positions, hit testing, widget focus and animation timing belong to your program. Text uses bitmap fonts, with no shaping engine or IME support. Rendering uses integer scales; on fractional-scale outputs the compositor resamples the buffer. There is no GPU renderer, clipboard, drag and drop, accessibility integration or public subsurface/DMA-BUF API in this release.

The API is young and may change. I'm keeping 0.1 focused on these drawing and surface primitives, with tests for the retained tree and rendering behavior.

Install

With Sigil 0.24, add this to your package's dependencies:

(from-pkg name: "sigil/sigil-ui" version: "^0.1")

Then run sigil deps install and build your program. To produce an executable, your package needs an entry: and a build config. The source and README include the demo, benchmarks and design notes. sigil-ui is licensed under BSD-3-Clause; the demo's Spleen fonts and vendored Wayland headers and protocol files under native/wayland/ carry their own licenses.

Commit

1268169dcaa9c4c8dcc4dbf977ce04a57856aea1

This commit is older than the 20 that keep a page here, so it has none. It is in the clone.

Releases