Function · Desktop Services
showFolderDialog
Displays a native folder-selection dialog.
@sharpts/gui · SharpTS 572a2e31be0eSignature
TypeScript
showFolderDialog(options: FolderDialogOptions = {}): Promise<string | null>Parameters
| Name | Type | Description |
|---|---|---|
options | FolderDialogOptionsDefault: {} | Dialog title options. |
Returns
Promise<string | null> — The selected folder path, or null when canceled.
Remarks
The returned value is a local filesystem path. Folders exposed only through a virtual storage provider produce null.
Throws
- When no desktop window is available or the native picker fails.
Examples
TypeScript
import { showFolderDialog } from "@sharpts/gui";
const folder = await showFolderDialog({ title: "Choose an export folder" });
if (folder !== null) console.log(folder);Related symbols
Source
src/SharpTS.Gui.Sdk/GuiPackage/runtime.ts:1626 at SharpTS revision 572a2e31be0e2a09be0138bc44501b34d6245b51.