zui docs v0.0.5
GitHub ↗
Zui guide · 01

Quickstart

Install Zui, configure the native client, and open your first Ruby-owned desktop window.

Updated for Zui 0.0.5·1 minute read

Start with one Ruby file

Zui applications are Ruby and assets. The native Qt client renders the component tree, while your Ruby process owns state, events, scheduling, and application logic.

gem install zui
zui doctor --fix
zui new telemetry-console
cd telemetry-console
zui run main.rb

Your first surface

Define an application module and return a native surface from Zui.app. Containers accept nested Ruby blocks, so hierarchy remains obvious.

require "zui"

module Counter
  def self.run
    Zui.app do
      state :count, 0

      app :main, title: "Counter", width: 640, height: 420 do
        card padding: 24, spacing: 16 do
          label "Counter", bold: true
          text { "Count: #{state.count}" }
          button("Increment") { state.count += 1 }
        end
      end
    end
  end
end

Counter.run

Configure once per version

zui doctor --fix downloads the matching native client, checks its checksum and manifest, and stores it in Zui's versioned user cache. Your gem stays small, and application bundles use their own private client copy.

Zui never downloads a browser engine. The client contains the Qt/QML host and the libraries needed by native components.

Build a distributable app

zui bundle

The bundle combines your application, assets, the Zui framework runtime, and the configured native client for the current platform.