Zum Inhalt springen

Capabilities for Different Windows and Platforms

Dieser Inhalt ist noch nicht in deiner Sprache verfügbar.

This guide will help you customize the capabilities of your Tauri app.

  • Create multiple windows in a Tauri app
  • Use different capabilities for different windows
  • Use platform-specific capabilities

This exercise is meant to be read after completing Using Plugin Permissions.

  1. Create Multiple Windows in a Tauri Application

    Section titled “Create Multiple Windows in a Tauri Application”

    Here we create an app with two windows labelled first and second. There are multiple ways to create windows in your Tauri application.

    Create Windows with the Tauri Configuration File

    Section titled “Create Windows with the Tauri Configuration File”

    In the Tauri configuration file, usually named tauri.conf.json:

    In the Rust code to create a Tauri app:

  2. Apply Different Capabilities to Different Windows

    Section titled “Apply Different Capabilities to Different Windows”

    The windows of a Tauri app can use different features or plugins of the Tauri backend. For better security it is recommended to only give the necessary capabilities to each window. We simulate a scenario where the first windows uses filesystem and dialog functionalities and second only needs dialog functionalities.

    It is recommended to separate the capability files per category of actions they enable.

    Give filesystem capabilities to the first window

    Section titled “Give filesystem capabilities to the first window”

    We give the first window the capability to have read access to the content of the $HOME directory.

    Give dialog capabilities to the first and second window

    Section titled “Give dialog capabilities to the first and second window”

    We give to first and second windows the capability to create a “Yes/No” dialog

  3. We now want to customize the capabilities to be active only on certain platforms. We make our filesystem capabilities only active on linux and windows.

We have learned how to create multiple windows in a Tauri app and give them specific capabilities. Furthermore these capabilities can also be targeted to certain platforms.

An example application that used window capabilities can be found in the api example of the Tauri Github repository. The fields that can be used in a capability file are listed in the Capability reference.


© 2026 Tauri Contributors. CC-BY / MIT