Skip to main content
openDirectoryPicker shows the platform’s native folder dialog and returns the selected folder as a PlatformFile.

Usage

The result is null when the user cancels. Failures go to onError in Compose, or are thrown as a FileKitDialogException by the suspend API. See Results and errors.

Try it

This is the FileKit sample running in your browser. Pick a folder to browse its contents as a tree, then open a file to inspect its metadata.

Options

In Compose, pass these options to rememberDirectoryPickerLauncher. launch() takes no arguments.
PlatformFile?
default:"null"
Folder the dialog opens in. Ignored on the web.
FileKitDialogSettings
default:"createDefault()"
Title, parent window, and other per-platform settings.

Read the folder’s contents

Call list() for the direct children or walk() for the whole tree. See File operations.

Keep access across launches

A picked folder is only accessible for the current session on Android and Apple platforms. Save its bookmark to reopen it after a restart:
nonWebMain
saveBytes and loadBytes stand for your own storage. See Bookmark data for invalid bookmarks and security-scoped access on Apple platforms.

Platform notes