Native system dialogs for opening and saving files.
This package is also accessible with window.__TAURI__.dialog when tauri.conf.json > build > withGlobalTauri is set to true.
The APIs must be allowlisted on tauri.conf.json:
{
"tauri": {
"allowlist": {
"dialog": {
"all": true, // enable all dialog APIs
"open": true, // enable file open API
"save": true // enable file save API
}
}
}
}It is recommended to allowlist only the APIs you use for optimal bundle size and security.
Interfaces#
Functions#
open#
▸ open(options?): Promise<string | string[]>
Open a file/directory selection dialog
Parameters#
| Name | Type |
|---|---|
options | OpenDialogOptions |
Returns#
Promise<string | string[]>
A promise resolving to the selected path(s)
Defined in#
save#
▸ save(options?): Promise<string>
Open a file/directory save dialog.
Parameters#
| Name | Type |
|---|---|
options | SaveDialogOptions |
Returns#
Promise<string>
A promise resolving to the selected path.