This file provides guidance to AI coding assistants when working with code in this repository.
Slint is a declarative GUI toolkit for building native user interfaces across embedded systems, desktops, mobile, and web platforms. UIs are written in .slint markup files and connected to business logic in Rust, C++, JavaScript, or Python.
cargo build # Build the workspace
cargo build --release # Release build (use this flag whenever testing performance)
cargo test # Run tests (requires cargo build first!)
cargo build --workspace --exclude uefi-demo # Build all examplescargo run -p gallery # Run the gallery example
cargo run --bin slint-viewer -- path/to/file.slint # View a .slint filecargo build --lib -p slint-cpp # Build C++ library
mkdir cppbuild && cd cppbuild
cmake -GNinja ..
cmake --build .cd api/node && pnpm installImportant: Run cargo build before cargo test - the dynamic library must exist first.
cargo test -p test-driver-interpreter # Fast interpreter tests
cargo test -p test-driver-rust # Rust API tests
cargo test -p test-driver-cpp # C++ tests (build slint-cpp first)
cargo test -p test-driver-nodejs # Node.js tests
cargo test -p doctests # Documentation snippet teststests/run_tests.sh rust layout # Filter by namecargo test -p i-slint-compiler --features display-diagnostics --test syntax_tests
SLINT_SYNTAX_TEST_UPDATE=1 cargo test -p i-slint-compiler --test syntax_tests # Update expected errorscargo test -p test-driver-screenshots # Compare against references
SLINT_CREATE_SCREENSHOTS=1 cargo test -p test-driver-screenshots # Generate references-
internal/compiler/- Slint language compiler (lexer, parser, code generators)parser/- .slint syntax parsing using Rowanpasses/- Optimization passesgenerator/- Code generators for C++, Rust, Python, JStests/syntax/- Syntax error test cases
-
internal/core/- Runtime library (properties, layout, animations, accessibility) -
internal/core-macros/- Procedural macros for i-slint-core -
internal/common/- Shared code and data structures between compiler and runtime -
internal/interpreter/- Dynamic compilation for scripting languages -
internal/backends/- Platform windowing/input:winit/- Cross-platform (primary)qt/- Qt integrationandroid-activity/- Android platform supportlinuxkms/- Linux KMS/DRM direct renderingselector/- Runtime backend selectiontesting/- Testing backend for automated tests
-
internal/renderers/- Rendering engines:femtovg/- OpenGL ES 2.0skia/- Skia graphicssoftware/- CPU-only fallback
rs/slint/- Rust public craters/macros/-slint!procedural macrors/build/- Build script supportcpp/- C++ API with CMake integrationnode/- Node.js bindings (Neon)python/- Python bindings (PyO3)wasm-interpreter/- WebAssembly bindings for browser use
tools/lsp/- Language Server Protocol for editor integrationtools/compiler/- CLI compilertools/viewer/- .slint file viewer with hot reloadtools/slintpad/- Web-based Slint editor/playgroundtools/figma_import/- Import designs from Figmatools/tr-extractor/- Translation string extractor for i18ntools/updater/- Migration tool for Slint version updates
vscode/- Visual Studio Code extensionzed/- Zed editor integrationkate/- Kate editor syntax highlightingsublime/- Sublime Text supporttree-sitter-slint/- Tree-sitter grammar for syntax highlighting
- Internal crates (
internal/) are not semver-stable - they use exact version pinning - FFI modules are gated with
#[cfg(feature = "ffi")] - C++ headers generated via
cargo xtask cbindgen - Extensive Cargo features control renderers (
renderer-femtovg,renderer-skia,renderer-software) and backends (backend-winit,backend-qt)
- The default git branch is
master
- Rust:
rustfmtenforced in CI - C++:
clang-formatenforced in CI - Linear git history preferred (rebase/squash merges)
# Debian/Ubuntu
sudo apt install libxcb-shape0-dev libxcb-xfixes0-dev libxkbcommon-dev \
libfontconfig-dev libssl-dev clang libavcodec-dev libavformat-dev \
libavutil-dev libavfilter-dev libavdevice-dev libasound2-dev pkg-configxcode-select --install
brew install pkg-config ffmpeg- Enable symlinks:
git clone -c core.symlinks=true https://github.com/slint-ui/slint - Install MSVC Build Tools
- FFMPEG via vcpkg or manual installation
For tasks requiring deeper architectural understanding, see:
docs/development/compiler-internals.md- Compiler pipeline, passes, LLR, code generation. Load when working oninternal/compiler/.docs/development/type-system.md- Type definitions, unit types, type conversions, name resolution, type register. Load when working onlangtype.rs,lookup.rs, or type checking.docs/development/property-binding-deep-dive.md- Reactive property system, dependency tracking, two-way bindings, PropertyTracker, ChangeTracker. Load when working oninternal/core/properties.rsor debugging binding issues.docs/development/custom-renderer.md- Renderer traits, drawing API, backend integration, testing. Load when working oninternal/renderers/or fixing drawing bugs.docs/development/animation-internals.md- Animation timing, easing curves, performance, debugging. Load when working oninternal/core/animations.rsor animation-related issues.docs/development/layout-system.md- Layout solving, constraints, GridLayout/BoxLayout, compile-time lowering. Load when working oninternal/core/layout.rsor sizing/positioning bugs.docs/development/item-tree.md- Item tree structure, component instantiation, traversal, focus. Load when working oninternal/core/item_tree.rs, event handling, or runtime component model.docs/development/model-repeater-system.md- Model trait, VecModel, adapters (map/filter/sort), Repeater, ListView virtualization. Load when working oninternal/core/model.rsor data binding inforloops.docs/development/input-event-system.md- Mouse/touch/keyboard events, event routing, focus management, drag-drop, shortcuts. Load when working oninternal/core/input.rsor event handling.docs/development/text-layout.md- Text shaping, line breaking, paragraph layout, styled text parsing. Load when working oninternal/core/textlayout/or text rendering.docs/development/window-backend-integration.md- WindowAdapter trait, Platform trait, WindowEvent, popup management, backend implementations. Load when working oninternal/core/window.rsorinternal/backends/.docs/development/lsp-architecture.md- LSP server, code completion, hover, semantic tokens, live preview. Load when working ontools/lsp/or IDE tooling.docs/development/ffi-language-bindings.md- C++/Node.js/Python bindings, cbindgen, FFI patterns, adding new cross-language APIs. Load when working onapi/or internal FFI modules.