How to Add a Lightweight Animated Mascot to a Tauri Desktop App
By the Charmotion team · Updated · How we write guides

Add an animated Rive mascot to a Tauri desktop app by setting one window to transparent in tauri.conf.json, loading a small .riv file in the webview with the Rive canvas-lite runtime, and serving the Rive WASM file from your own app. The mascot stays light because it is a vector state machine, not a video.
Key takeaways
- A desktop mascot works best in its own small transparent window, declared in tauri.conf.json.
- Rive playback in a Tauri webview needs only a small WASM runtime, and you can bundle that file yourself.
- Transparency and installer size depend on each platform's webview, so test on Windows, macOS and Linux.
- Charmotion can produce the .riv file from one character image, with fixed mood numbers for each state.
- Keep the mascot idle-light: one canvas, one state machine and no video playing in the background.
Already have a character or logo? See examples in real app screens: splash, onboarding, loading and empty-state screens, with the animation that plays in each.
How to add an animated mascot to a Tauri desktop app?
A Tauri app is a web frontend (HTML, CSS and JavaScript) running in a native window, with a Rust backend. That makes it a good host for a mascot. The mascot is a web element drawn on a canvas, and its window can be made transparent so only the character is visible on the desktop.
The work has four parts: declare a transparent window, load the animation, keep the runtime small and check each platform. Tauri is still maintained: its 2.12 release line and the 2.12.7 patch, dated November 2026, are current as of December 2026.
You need a finished character image and a Rive file for it. The file can come from the Rive editor or from a generator. This guide assumes you already have a .riv file with a state machine. Open it in the Rive file inspector first to confirm the state machine and input names before you wire anything in.
How do you make the Tauri window transparent?
Declare a dedicated window in the app.windows array of tauri.conf.json and set transparent to true. Turn off decorations so the title bar disappears, and keep the window small so it covers only the mascot.
{
"app": {
"windows": [
{
"label": "mascot",
"title": "Mascot",
"width": 240,
"height": 240,
"transparent": true,
"decorations": false,
"alwaysOnTop": true,
"resizable": false,
"noRedirectionBitmap": true
}
]
}
}
The config reference documents transparent as a boolean on the window settings. The noRedirectionBitmap option is for Windows: it can help avoid a white flash when a transparent window is created, so keep it on the mascot window. Each entry in app.windows with its own label creates a separate window next to your main one.
On macOS, Tauri 2.12.1 removed the need for the macOS private API flag to use transparency. The release notes do not say how far back that applies. If you pin an older 2.x version, check its notes before assuming transparency works without the flag.
Transparent windows have also been reported as unsupported on Windows 7, where they can cause visual artifacts. Check Tauri's current documentation before you promise support on that system.
The page inside the window must be transparent too, or the webview paints its own background. Add this to the stylesheet for the mascot page:
html, body {
background: transparent;
margin: 0;
overflow: hidden;
}
How do you load a Rive mascot in the webview?
Install the lightweight Rive web package. Rive's migration guide says @rive-app/canvas-lite is the option for a version without Rive Text, Layouts, Audio and Scripting. A mascot that only plays a state machine usually does not need those features, so the lighter package is the right default.
npm install @rive-app/canvas-lite
Create the player on a canvas and name the state machine. Put the .riv file in your frontend folder so the build copies it into the app:
import { Rive } from "@rive-app/canvas-lite";
const canvas = document.getElementById("mascot");
const rive = new Rive({
src: "mascot.riv",
canvas,
autoplay: true,
stateMachines: "CharacterStateMachine",
onLoad: () => rive.resizeDrawingSurfaceToCanvas(),
});
To change what the mascot shows, set its number input mood. Charmotion's mood numbers are fixed: idle 0, happy 1, wave 2, thinking 3, sad 4, loading 5, listening 6, talking 7, sleeping 8 and attention 9. Moods blend into each other, so you can switch them while the app runs:
const inputs = rive.stateMachineInputs("CharacterStateMachine");
const mood = inputs.find((input) => input.name === "mood");
mood.value = 5; // loading
In a desktop app the state usually comes from Rust, such as a background job or a sync process. Emit a Tauri event from the backend when that state changes, listen for it in the frontend and set the mood. The mascot then reflects real work instead of a timer. For the input model in more depth, see Rive state machine inputs.
How do you keep the mascot lightweight?
A mascot should add little to a desktop app's memory, CPU and install size. Three choices matter most: the runtime package, where the WASM file comes from and how the installer ships the webview.
Choose the smallest runtime
Use @rive-app/canvas-lite, as shown above. Rive's migration guide says the WASM request for v2.0.0 and later is about 261 KB brotli-compressed. Figures vary by build, so measure your own output with your bundler before you set a budget.
Bundle the WASM file
By default, Rive's low-level API loads rive.wasm from unpkg, which makes a network call to the CDN. A desktop app that should start offline needs its own copy. Rive's preloading page says self-hosting gives you control over the WASM origin, faster initialization and the caching policy.
Three rules apply when you host it yourself:
- Match the
rive.wasmversion to the@rive-apppackage inpackage.json. The two are built as a pair. - Serve the file with the
application/wasmMIME type, or the browser falls back to a slower path. In a Tauri app, check this in the webview's network log. - Use the optional
WASM_URLsetting from Rive's preloading page to point the runtime at your copy, and start loading early in page load.
For a similar bundling pattern in a browser extension, see Rive in a Chrome extension.
Account for the installer
On Windows, Tauri's WebView2 installation mode changes the installer size. Tauri's Windows installer page gives these figures:
| WebView2 mode | Added to installer | Trade-off |
|---|---|---|
| downloadBootstrapper (default) | 0 MB | Needs internet access during install |
| embedBootstrapper | About 1.8 MB | Bootstrapper is bundled |
| offlineInstaller | About 127 MB | Works without internet |
| fixedVersion | About 180 MB | Ships a fixed WebView2 version |
A mascot does not change this choice much, since the webview is the same either way. Pick the mode your install environment needs, and budget for it. Tauri does not bundle a browser engine. On Windows it uses WebView2 (Chromium-based). On macOS it uses WKWebView, and on Linux it uses webkit2gtk.
Where does the mascot's .riv file come from?
You can build the file in the Rive editor by hand. If you start from one character image, Charmotion can produce the file for you. It checks that the image is one finished, coloured character facing the viewer with visible eyes and mouth, rigs the drawing and returns one Rive (.riv) file.
The file contains CharacterViewModelMachine (a number property named mood), CharacterStateMachine (a number input named mood) and, if you pick launch, LaunchStateMachine, which plays once and then goes to idle. Some moods show small accents such as sparkles or thinking dots. The boolean accents hides them. Charmotion also includes web, React and SwiftUI code, a README and an AI_README for coding assistants, along with transparent WebM and MOV copies of each animation.
Charmotion does not write Tauri configuration, so the window setup and the bundling in this guide remain your job. Start from a PNG on the PNG to Rive page, and see pricing for plan details.
What should you test on each platform?
Transparency and rendering are the parts most likely to differ between operating systems, because each uses its own webview. Test these before you ship:
- Windows: check for a white flash when the mascot window opens, and confirm the WebView2 mode you ship matches your install plan. If you still support Windows 7, test transparency there separately.
- macOS: confirm transparency on the oldest 2.x version you support, since the private API flag change came in 2.12.1.
- Linux: the webview is webkit2gtk. Check transparency on each distribution you target.
- All platforms: measure idle CPU with the mascot visible and hidden. Tauri does not document frame-rate limits for transparent webviews, so measure it yourself.
Keep one canvas and one state machine per window. Do not play a video behind the mascot. A transparent window that redraws only when the mood changes is the lightest version of this setup. The same idea appears in the OBS mascot overlay guide, which uses a transparent source for a character on screen.
How to add an animated mascot to a Tauri desktop app
- Declare a mascot window. In tauri.conf.json, add a window entry under app.windows with a unique label, a small width and height, "transparent": true and "decorations": false.
- Make the page background transparent. Set html and body to a transparent background with zero margin and hidden overflow in the mascot page's stylesheet.
- Install the runtime and load the .riv file. Run npm install @rive-app/canvas-lite, then create a Rive player on a canvas with src set to your .riv file and stateMachines set to CharacterStateMachine.
- Bundle rive.wasm with the app. Copy rive.wasm into your frontend build, match its version to the @rive-app package, serve it as application/wasm and point the runtime at it with WASM_URL.
- Drive the mood from app state. Emit a Tauri event from Rust when the app's state changes, listen for it in the frontend and set the mood number input to the matching value.
- Test on each operating system. Check for a white flash on Windows, transparency on macOS and Linux, the WebView2 installer mode and idle CPU with the mascot visible and hidden.
Frequently asked questions
Can the mascot stay on top of other windows?
Yes. Tauri's window settings include alwaysOnTop, which you can set to true on the mascot window in tauri.conf.json. Use it with care: a mascot that always floats above every app can get in the way. Consider making it a user choice, and remember that the mascot window is separate from your main window, so both need their own settings.
Can I use Lottie instead of Rive for the mascot?
You can, but this guide uses Rive because the mascot's moods are state machine inputs that the app sets while it runs. Tauri's documentation does not cover a Lottie player, so you would need to check that runtime's own docs. For the difference, see Lottie vs Rive state machines.
Does the mascot work offline?
Yes, if you bundle rive.wasm and the .riv file with the app. The default Rive loader fetches the WASM file from unpkg, which needs a network connection. Self-hosting removes that dependency, and it also gives you control over caching.
Is Rive free for a commercial desktop app?
Rive's Free plan can export .riv files, but exported files play a Rive splash screen, and paid plans export without it. Plan names and prices change, so check the current details in the pricing guide before you ship a commercial app.
Sources
- Tauri configuration reference, Tauri
- Tauri webview versions, Tauri
- Tauri Windows installer, Tauri
- Tauri 2 release notes, Tauri
- Rive WASM preloading, Rive
- Rive low-level API usage, Rive