Skip to main content
FileKit allows you to customize dialog behavior with platform-specific settings. Each platform has its own settings class that can be configured according to your needs.

Platform-Specific Settings

JVM Settings

On JVM platforms (Windows, macOS, Linux), you can customize:
  • title: Set a custom title for the dialog
  • parent: Set the typed parent window identity used for modality and stacking
  • macOS: Configure macOS-specific settings
FileKitDialogParent represents one canonical parent, with factories for each supported JVM window system:
The parent is borrowed. Keep the AWT window, HWND, X11 window, or Wayland export alive until the suspending picker call completes. FileKit never takes ownership or extends its lifetime.
wayland() accepts the unprefixed opaque handle exported through xdg_foreign. FileKit adds the wayland: portal prefix without trimming or normalizing the value. A raw wl_surface*, a Tao handle, and a string that you invented from a pointer are not exported Wayland handles.
Invalid factory arguments, such as a zero HWND, an out-of-range XID, or an empty Wayland handle, throw IllegalArgumentException. A valid parent that the active picker cannot use, or an AWT parent that cannot resolve to a native identifier, throws FileKitPickerException before opening the dialog.

Compose Desktop

The WindowScope.remember*Launcher extensions automatically use the scope’s AWT window and replace any parent already present in the supplied settings. For a plain launcher or direct picker call, provide it explicitly:

Migrating from FileKit 0.14

The JVM settings API intentionally changed in FileKit 0.15. Replace:
with:
There is no compatibility parentWindow property or constructor.

Nucleus with the Tao backend

Nucleus 2.3.2 exposes the native identities needed to parent Tao dialogs on Windows and Linux/X11. Adapt the framework-specific window locally and pass the resulting settings to a plain, non-WindowScope launcher:
Do not pass nucleusWindow.unsafe.taoHandle: it is an opaque Tao event-loop identity, not an operating-system dialog parent. On Wayland, x11WindowId is null, so this adapter deliberately opens an unparented dialog. Wayland parent exports and macOS NSWindow sheets are deferred pending community feedback; both require lifecycle handling beyond these direct Windows and X11 conversions. The dialog also remains unparented when the Nucleus window has not exposed a supported identity yet.

iOS and macOS Settings

On iOS and macOS, you can configure:
  • title: Set a custom title for the dialog
  • canCreateDirectories: Allow or prevent directory creation in dialogs (default: true)
On iOS, you can also configure:
  • assetRepresentationMode: Choose the Photos picker asset representation mode (default: Automatic)
  • presenter: Set the UIViewController used to present native dialogs. If null, FileKit uses the current top-most controller.
The iOS Photos picker supports these asset representation modes:
  • Automatic: Let the system choose the best representation
  • Current: Prefer the original/current representation and avoid transcoding when possible
  • Compatible: Prefer a broadly compatible representation, even if transcoding is required
Use Compatible when picked image bytes need to be decoded by libraries that may not support every Apple-native image format, such as HEIF/HEIC.

Android, Web, and WASM

These platforms currently don’t have any specific settings to configure. Use the default settings:

Using DialogSettings in KMP

When working with Kotlin Multiplatform projects, you might need to handle platform-specific settings differently. Here’s how to use expect/actual to manage dialog settings: For platforms that need specific configuration, use expect/actual:
You can then use the platform-specific settings in your shared code:
This approach allows you to:
  • Keep your common code platform-agnostic
  • Provide platform-specific configurations where needed
  • Maintain type safety across platforms
Platform-specific settings are continuously evolving. You can ask for a feature or report a bug on the GitHub repository.