Expand description
Tauri is a framework for building tiny, blazing fast binaries for all major desktop platforms. Developers can integrate any front-end framework that compiles to HTML, JS and CSS for building their user interface. The backend of the application is a rust-sourced binary with an API that the front-end can interact with.
§Cargo features
The following are a list of Cargo features that can be enabled or disabled:
- wry (enabled by default): Enables the wry runtime. Only disable it if you want a custom runtime.
- common-controls-v6 (enabled by default): Enables Common Controls v6 support on Windows, mainly for the predefined
aboutmenu item. - x11 (enabled by default): Enables X11 support. Disable this if you only target Wayland.
- dbus (enabled by default): Enables dbus dependency for theme support on Linux. Disable this if you do not need theme support or don’t want to build the dbus rust crate. The WebView dependencies use dbus either way.
- unstable: Enables unstable features. Be careful, it might introduce breaking changes in future minor releases.
- tracing: Enables
tracingfor window startup, plugins,Window::eval, events, IPC, updater and custom protocol request handlers. - test: Enables the
testmodule exposing unit test helpers. - objc-exception: This feature flag is no-op since 2.3.0.
- linux-libxdo: Enables linking to libxdo which enables Cut, Copy, Paste and SelectAll menu items to work on Linux.
- isolation: Enables the isolation pattern. Enabled by default if the
app > security > pattern > useconfig option is set toisolationon thetauri.conf.jsonfile. - custom-protocol: Feature managed by the Tauri CLI. When enabled, Tauri assumes a production environment instead of a development one.
- devtools: Enables the developer tools (Web inspector) and
window::Window. Enabled by default on debug builds. On macOS it uses private APIs, so you can’t enable it if your app will be published to the App Store. - native-tls: Provides TLS support to connect over HTTPS.
- native-tls-vendored: Compile and statically link to a vendored copy of OpenSSL.
- rustls-tls: Provides TLS support to connect over HTTPS using rustls.
- process-relaunch-dangerous-allow-symlink-macos: Allows the
process::current_binaryfunction to allow symlinks on macOS (this is dangerous, see the Security section in the documentation website). - tray-icon: Enables application tray icon APIs. Enabled by default if the
trayIconconfig is defined on thetauri.conf.jsonfile. - macos-private-api: Enables features only available in macOS’s private APIs, currently the
transparentwindow functionality and thefullScreenEnabledpreference setting totrue. Enabled by default if thetauri > macosPrivateApiconfig flag is set totrueon thetauri.conf.jsonfile. - webview-data-url: Enables usage of data URLs on the webview.
- compression *(enabled by default): Enables asset compression. You should only disable this if you want faster compile times in release builds - it produces larger binaries.
- config-json5: Adds support to JSON5 format for
tauri.conf.json. - config-toml: Adds support to TOML format for the configuration
Tauri.toml. - image-ico: Adds support to parse
.icoimage, seeimage::Image. - image-png: Adds support to parse
.pngimage, seeimage::Image. - macos-proxy: Adds support for
WebviewBuilder::proxy_urlon macOS. Requires macOS 14+. - specta: Add support for
specta::spectawith Tauri arguments such asState,WindowandAppHandle - dynamic-acl (enabled by default): Enables you to add ACLs at runtime, notably it enables the
Manager::add_capabilityfunction.
§Cargo allowlist features
The following are a list of Cargo features that enables commands for Tauri’s API package.
These features are automatically enabled by the Tauri CLI based on the allowlist configuration under tauri.conf.json.
§Protocol allowlist
- protocol-asset: Enables the
assetcustom protocol.
Re-exports§
pub use self::webview::Webview;pub use self::webview::WebviewWindow;pub use self::webview::WebviewWindowBuilder;pub use self::window::Monitor;pub use self::window::Window;pub use self::webview::WebviewBuilder;unstablepub use self::window::WindowBuilder;unstablepub use tauri_utils as utils;pub use http;pub use scope::*;
Modules§
- async_
runtime - The singleton async runtime used by Tauri and exposed to users.
- image
- Image types used by this crate and also referenced by the JavaScript API layer.
- ipc
- Types and functions related to Inter Procedure Call(IPC).
- menu
desktop - Menu types and utilities.
- path
- Path APIs.
- plugin
- The Tauri plugin extension to expand Tauri functionality.
- process
- Types and functions related to child processes management.
- scope
- The allowlist scopes.
- test
test - Utilities for unit testing on Tauri applications.
- tray
desktopandtray-icon - Tray icon types and utilities.
- webview
- The Tauri webview types and functions.
- window
- The Tauri window types and functions.
Macros§
- generate_
context - Reads the config file at compile time and generates a
Contextbased on its content. - generate_
handler - Accepts a list of command functions. Creates a handler that allows commands to be called from JS with invoke().
- include_
image - Convert a .png or .ico icon to an Image
for things like
tauri::tray::TrayIconBuilderto consume, relative paths are resolved fromCARGO_MANIFEST_DIR, not current file - tauri_
build_ context - Include a
Contextthat was generated bytauri-buildinside your build script.
Structs§
- App
- The instance of the currently running application.
- AppHandle
- A handle to the currently running application.
- Asset
- A resolved asset.
- Asset
Resolver - The asset resolver is a helper to access the
crate::Assetsinterface. - Builder
- Builds a Tauri application.
- Close
Request Api - Api exposed on the
CloseRequestedevent. - Config
- The Tauri configuration object. It is read from a file where you can define your frontend assets, configure the bundler and define a tray icon.
- Context
wry - User supplied data required inside of a Tauri application.
- Env
- Information about environment variables.
- Event
- An event that was emitted.
- Exit
Request Api - Api exposed on the
ExitRequestedevent. - Logical
Position - A position represented in logical pixels.
- Logical
Rect - A rectangular region in logical pixels.
- Logical
Size - A size represented in logical pixels.
- Logical
Unit - A logical pixel unit.
- Package
Info tauri::Apppackage information.- Physical
Position - A position represented in physical pixels.
- Physical
Rect - A rectangular region in physical pixels.
- Physical
Size - A size represented in physical pixels.
- Physical
Unit - A physical pixel unit.
- Rect
- A rectangular region.
- Resource
Table - Map-like data structure storing Tauri’s resources (equivalent to file descriptors).
- State
- A guard for a state value.
- State
Manager - The Tauri state manager.
- UriScheme
Context - Uri scheme protocol context
- UriScheme
Responder - Async uri scheme protocol responder.
- Url
- A parsed URL record.
- Window
Size Constraints - Window size constraints
Enums§
- Cursor
Icon - Describes the appearance of the mouse cursor.
- Device
Event Filter - Drag
Drop Event - The drag drop event payload.
- Error
- Runtime errors that can happen inside a Tauri application.
- Event
Loop Message - The user event type.
- Event
Target - Event Target
- Pattern
- An application pattern.
- Pixel
Unit - A pixel unit that’s either physical or logical.
- Position
- A position that’s either physical or logical.
- RunEvent
- An application event, triggered from the event loop.
- Size
- A size that’s either physical or logical.
- Theme
- System theme.
- Title
BarStyle - How the window title bar should be displayed on macOS.
- User
Attention Type - Type of user attention requested on a window.
- Webview
Event - An event from a window.
- Webview
Url - An URL to open on a Tauri webview window.
- Window
Event - An event from a window.
Constants§
- RESTART_
EXIT_ CODE - The exit code on
RunEvent::ExitRequestedwhenAppHandleis called. - VERSION
- The Tauri version.
Traits§
- Assets
- Represents a container of file assets that are retrievable during runtime.
- Emitter
- Emit events.
- Listener
- Listen to events.
- Manager
- Manages a running application.
- Pixel
- Resource
- Resources are Rust objects that are stored in ResourceTable and managed by tauri.
- Runtime
- The webview runtime interface. A wrapper around
runtime::Runtimewith the proper user event type associated. - Runtime
Handle - The webview runtime handle. A wrapper around
runtime::RuntimeHandlewith the proper user event type associated.
Functions§
- is_dev
- Whether we are running in development mode or not.
- webview_
version wry - Get WebView/Webkit version on current platform.
Type Aliases§
- EventId
- Unique id of an event.
- Resource
Id - A
ResourceIdis an integer value referencing a resource. It could be considered to be the tauri equivalent of afile descriptorin POSIX like operating systems. - Result
Result<T, ::tauri::Error>- Sync
Task - A task to run on the main thread.
- Wry
wry - A Tauri
Runtimewrapper around wry. - WryHandle
wry - A Tauri
RuntimeHandlewrapper around wry.
Attribute Macros§
- command
- Mark a function as a command handler. It creates a wrapper function with the necessary glue code.