Sigil

Getting started

The package is sigil-ui. The library name is sigil, so imports read sigil::.

Requirements

  • Rust 1.90 or newer.
  • On Linux, the window host needs the GTK3, udev, ALSA, xkbcommon, and xdo development packages. On Debian and Ubuntu: sudo apt-get install libgtk-3-dev libudev-dev libasound2-dev libxkbcommon-dev libxkbcommon-x11-dev libxdo-dev. The terminal host needs none of them.
  • A wgpu-capable GPU for the default renderer of the window host. Set SIGIL_BACKEND=cpu to use the CPU renderer. The terminal host needs no GPU.

Install

Sigil needs Rust 1.90 or newer. Add the package with the window host:

[dependencies]sigil-ui = { git = "https://github.com/manaforged/sigil" }

For the terminal host only, without the GPU stack:

[dependencies]sigil-ui = { git = "https://github.com/manaforged/sigil", default-features = false, features = ["terminal"] }

Open a window

Write use sigil::prelude::*;. The prelude brings in run, Host, root, the widgets, and the signals.

use sigil::prelude::*; fn main() -> sigil::AppResult<()> {    sigil::run(AppConfig::new("Sigil - hello-counter").size(480, 240), app_tree)} fn app_tree() -> impl IntoNode {    let count = signal(0_i32);    column()        .layout(LayoutStyle::default().padding(32.0))        .bg(Token::Surface)        .child(text(move || format!("Count: {}", count.get())))        .child(button("Increment").primary().activate(move || count.update(|n| *n += 1)))}
use sigil::prelude::*; fn main() -> sigil::AppResult<()> {  sigil::run(    AppConfig::new(      "Sigil - hello-counter",    )    .size(480, 240),    app_tree,  )} fn app_tree() -> impl IntoNode {  let count = signal(0_i32);  column()    .layout(      LayoutStyle::default()        .padding(32.0),    )    .bg(Token::Surface)    .child(text(move || {      format!("Count: {}", count.get())    }))    .child(      button("Increment")        .primary()        .activate(move || {          count.update(|n| *n += 1)        }),    )}

Run in a terminal

Turn on the terminal feature and call .terminal() on the config.

use sigil::prelude::*; fn main() -> sigil::AppResult<()> {    sigil::run(AppConfig::new("hello-terminal").terminal(), || {        text("hello")    })}
use sigil::prelude::*; fn main() -> sigil::AppResult<()> {  sigil::run(    AppConfig::new("hello-terminal")      .terminal(),    || text("hello"),  )}

Features

FeatureDefaultEnables
desktopyesThe window host for run, open, and the OS clipboard. Turns on scene, clipboard, and winit with AccessKit.
terminalnoThe terminal host: run with .terminal(), and sigil::terminal, including sigil::terminal::render. Uses crossterm and enables image-decode.
scenevia desktopThe wgpu renderer, the CPU renderer, offscreen capture through sigil::renderer::capture, text shaping, SVG icons, and sigil::text. No window.
shellvia desktopThe winit window shell with AccessKit.
cpuvia sceneThe CPU renderer that SIGIL_BACKEND=cpu selects.
shaping-complexvia sceneComplex-script text shaping through HarfRust.
rendernoScene rendering without a window. Turns on scene.
clipboardvia desktopOsClipboard, the system clipboard.
clipboard-imagenosigil::clipboard::image(), images from the system clipboard.
image-decodenoimage_bytes, and data: images in markdown.
dialognosigil::app::dialog: in-app open, save, folder, message, and confirm dialogs on either host.
native-dialognoNative dialogs on the window host; the terminal host keeps the in-app dialogs. Turns on dialog and desktop.
menunosigil::app::menu: native application menus. Turns on desktop.
traynosigil::app::tray: system tray icons and events. Turns on menu.
audionoPlayer for audio playback.
notifynoDesktop notifications through sigil::app::notify.
medianoNow-playing metadata and media-key events through sigil::app::media. Turns on desktop.
hotkeynoGlobal keyboard shortcuts through sigil::app::hotkey. Turns on desktop.
hotnoCode hot reload under dx serve --hot-patch: run mounts the root again after each patch; an embed host uses Host::mount_hot. Uses subsecond and dioxus-devtools. Not on wasm.
ptynoSession: a child process on a pseudo-terminal.
kittestnoTest support for sigil-kittest. Not API.
test-clocknoManual interval clock for tests.
inspectnoThe local inspection socket when SIGIL_INSPECT is set.