Skip to content

factorio-rs-gui

factorio-rs-gui is an ecosystem crate: reactive builders, state! hooks, and mount/install helpers on top of factorio-rs. It ships as both a Cargo crate (authoring) and a Factorio library mod (runtime require).

crates.io factorio-rs-gui
Factorio mod factorio-rs-gui
Source ecosystem/factorio-rs-gui
Example examples/gui_counter, examples/gui_widgets
Core docs factorio-rs
  1. Getting started - dependency, first window, events
  2. Widgets - builders (Frame, Flow, Checkbox, …)
  3. Core GUI basics - imperative UI without reactivity
Guide Topic
Getting started First mount + events
State state! hooks and rebuilds
Lifecycle mount / install / events
Reactive GUI End-to-end counter pattern
Multiple windows Unique root_names
Widget Role
Frame Titled container
Flow Layout container
ScrollPane Scrollable container
Text Label
Button / SpriteButton Clicks
Checkbox / TextField / Slider / DropDown Interactive inputs
ProgressBar / Sprite / Line / EmptyWidget Display / layout leaves
Widget Enum + Into conversions

Cargo (typecheck + transpile):

[dependencies]
factorio-rs-gui = "0.1"

Factorio (runtime): install factorio-rs-gui from the mod portal and keep it enabled next to your mod. Building with the Cargo dependency merges factorio-rs-gui >= … into your info.json via [package.metadata.factorio] (Sharing code between mods).

Monorepo examples still use a path dependency; for apps, prefer crates.io.

  • Builders produce a concrete Widget tree.
  • state!(init) allocates a hook slot that survives rebuilds (per root name).
  • mount / install own the Factorio lifecycle glue and wire GUI events via script.on_event (no manual GUI event stubs).
  • Prefer factorio_rs_gui::shared::... paths so Factorio requires resolve against __factorio-rs-gui__/lua/....