Actively developed · Breaking changes are still expected.

Slint Kit Documentation

Search the documentation

    ↑ ↓ to browse · Enter to open · Escape to close

    Development loop: preview, rebuild and build times

    A Slint Kit application is a normal Cargo project: build.rs compiles your .slint files, then rustc compiles the generated Rust. A running application does not reload a changed .slint file. Choose the loop that matches what you are changing.

    Which loop to use

    You are changing Use Needs a Rust rebuild Shows
    Layout, spacing, theme tokens, declared content Editor preview (VS Code Live Preview) or slint-viewer --auto-reload No Static declarations; no Rust services
    A single component in isolation slint-viewer with --component No The same static rendering
    Behavior backed by slint_kit::install: filtering, validation, typed values, accepted selections cargo run Yes The real application
    Behavior in a browser WASM build from slint-kit new --web Yes Browser rendering; see Project setup
    Rust logic only cargo check, then cargo run Yes Compiler diagnostics first

    Keep the editor configured for @kit first: see Editor setup.

    Editor preview and slint-viewer

    The editor preview and slint-viewer compile your .slint file directly and reload it when it changes. They never run your Rust code or slint_kit::install, so they show layout and declared state only. The editor guide lists what each component family renders without services.

    Use a viewer and language server whose version matches the application's Slint version (currently 1.19.0). A viewer built for an older Slint release cannot compile the kit's library files.

    For a standalone preview, map the kit’s project file and optional resource directories exactly as in the editor:

    slint-viewer --auto-reload -L kit=target/slint-editor/vendor/slint-kit-slint/ui/slint-project.json -L kit-icons=target/slint-editor/vendor/slint-kit-slint/ui/icons/lucide -L kit-fonts=target/slint-editor/vendor/slint-kit-slint/ui/fonts --component App ui/preview.slint
    

    Keep the same @kit, @kit-icons/… and @kit-fonts/… imports as in your application. Add --load-data to start a preview from saved property values.

    SLINT_LIVE_PREVIEW is not supported

    Slint can generate Rust that reloads the .slint file at run time when the SLINT_LIVE_PREVIEW environment variable is set. In Slint 1.19.0 that generator omits the library globals that slint_kit::install needs (upstream issue #14812), so Slint Kit stops the build with an explanation. Do not set the variable, not even to 0 or an empty value. Re-check this page when you upgrade Slint.

    Build times

    These numbers come from one machine, so use them to compare steps, not to predict your own times. Each value is a single run, in seconds, of the project created by slint-kit new (Skia renderer, the desktop default).

    Step Time
    Cold build (empty target/) 48 to 54 s
    Build with no change 1.6 to 1.8 s
    Build after editing a .slint file 5.0 to 5.6 s
    Build after editing a Rust file 3.1 to 3.5 s
    cargo check after a .slint or Rust edit 1.2 to 3.4 s
    First cargo check after a clean target/ 12 to 31 s

    A .slint edit costs more than a Rust edit because the build script runs again: it verifies the kit's contracts, compiles your .slint files and generates the Rust that rustc then compiles. A first build after the build script has run still recompiles the application once, so a second build is the representative "no change" time.

    Earlier versions rewrote an internal wrapper file on every build, which made Cargo recompile the application even when nothing had changed. A build with no change took 5.0 to 6.5 s and a Rust edit 5.5 to 8.0 s before the fix. Upgrade to a release that includes it.

    Two settings made no measurable difference for this small project, so there is no reason to change them for speed alone:

    Times were not compared with a build before library mode, so this page makes no before/after claim for it.

    Settings for your project