A Steel (Scheme) component framework
for gpui +
gpui-component. Screens are
.scm files that build a plain-data element tree; slag decodes it once per
frame into real gpui elements. Saving a file hot-reloads in ~10 ms.
(require "slag/ui.scm")
(require-builtin hello/host)
(provide render init)
(define (init) (state-set! 'count 0))
(define (render)
(v-flex #:gap 8 #:p 16
(text "Hello from slag" #:size 'lg)
(text (number->string (state-ref 'count)))
(button 'bump #:label "Bump"
#:on-click (lambda () (state-set! 'count (+ 1 (state-ref 'count)))))))
examples/hello is the full wiring — host module, runtime,
config, component, shell — in ~60 lines of Rust.
slag-core— gpui-free: element model, sandboxed Steel runtime, host registry, effects, packs, fixtures. Tests run headless.slag-gpui— the gpui layer: component entity, materializer, string-keyed screen shell, hot reload.
Build notes for consumers (this workspace demonstrates all three):
- Declare
gpuideps as unpinned zed git URLs so cargo unifies them with gpui-component's, and pin the rev in your lockfile (match this repo's). - On Windows, carry the
[patch]forvendor/gpui_windowsand-C link-arg=/STACK:16777216in.cargo/config.toml.