slint/examples/servo
Burhan Khanzada e01af64ac2
Some checks are pending
autofix.ci / format_fix (push) Waiting to run
autofix.ci / lint_typecheck (push) Waiting to run
autofix.ci / ci (push) Blocked by required conditions
servo: Prepare for usage docs (#10121)
* refactor: Consolidate Servo initialization and event handling into a new `webview` module.

* [autofix.ci] apply automated fixes

* refactor: Move webview-related modules into the `webview` directory and update all internal import paths.

* refactor: move servo field to inner struct and add direct accessor

* docs: Add docs for webview module

* docs: Change webview module to public and improve example in docs

* [autofix.ci] apply automated fixes

* docs: Improve example in docs

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-11-21 11:45:18 +01:00
..
src servo: Prepare for usage docs (#10121) 2025-11-21 11:45:18 +01:00
ui servo: Prepare for usage docs (#10121) 2025-11-21 11:45:18 +01:00
.gitignore
build.rs
Cargo.lock servo: Improve Code (#10119) 2025-11-19 17:38:17 +01:00
Cargo.toml Servo encapsulation and cleanup (#10108) 2025-11-19 09:08:10 +01:00
README.md update Readme 2025-11-07 12:32:25 +00:00

Slint Servo Example

Disclaimer: Servo is still experimental and not ready for productions use.

Integrate Servo Web Engine as WebView Component for Slint to render websites using hardware rendring on MacOS, Linux and software rendring on android for now.

Preview

For Android build on Mac

Install Android Studio and JDK

brew install android-studio openjdk@17

Set these to .zshrc

export JAVA_HOME="/opt/homebrew/opt/openjdk@17"
export PATH=$JAVA_HOME/bin:$PATH

export ANDROID_HOME=~/Library/Android/sdk
export ANDROID_SDK_ROOT=$ANDROID_HOME

export ANDROID_NDK_HOME="$ANDROID_HOME/ndk/28.2.13676358"
export ANDROID_NDK_ROOT=$ANDROID_NDK_HOME

export PATH=$ANDROID_HOME/tools:$PATH
export PATH=$ANDROID_HOME/platform-tools:$PATH
export PATH=$ANDROID_HOME/cmdline-tools/latest/bin:$PATH

Install platofrm-tools, build-tools and ndk

sdkmanager platform-tools "platforms;android-30" "build-tools;34.0.0" "ndk;28.2.13676358"

Add rust target and install cargo apk

rustup target add aarch64-linux-android
cargo install cargo-apk

Run on android emulator or device

export BINDGEN_EXTRA_CLANG_ARGS="--target=aarch64-linux-android30 --sysroot=$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/darwin-x86_64/sysroot"
cargo apk run --target aarch64-linux-android --lib