Skip to main content
Supported on Android, iOS, macOS, JVM, JS and WASM targets

Quick start

Easily open a folder picker dialog to let users select a directory.
onError receives a FileKitDialogException only when FileKit cannot complete a valid directory operation. User cancellation is not a failure: it invokes onResult(null). Coroutine cancellation, invalid invocation, and unexpected defects continue to propagate normally. The compatibility overload without onError remains available and ignores normalized operational failures without logging. New integrations should use explicit error handling. See dialog error handling for the complete callback and propagation matrix.

Customizing the dialog

You can customize the dialog by setting the initial directory and platform-specific dialogSettings, such as a title on supported platforms.
Read more about dialog settings to customize the dialog for each platform.
On JS and WASM, directory picking uses the browser webkitdirectory input behavior. Browsers expose the selected directory as a flat list of files, so FileKit rebuilds a virtual directory tree from their relative paths. Empty directories are not available, and directory lastModified() values are synthetic.
macOS System AppearanceOn macOS, to ensure the directory picker dialog uses the system’s theme (light or dark), you may need to set a system property at the start of your application:
This is typically done in your main function, before the application window is created.