Open a file picker dialog in a Kotlin Multiplatform project
mode
parameter. FileKit provides four different selection modes:
Single
- Allows the user to select a single file (default).Multiple()
- Allows the user to select multiple files.SingleWithState
- Single file selection with state tracking.MultipleWithState()
- Multiple file selection with state tracking.Multiple
and MultipleWithState
modes support a maxItems
parameter to limit the number of files a user can select (1-50 files). If not specified, there’s no limit.type
parameter. You can pick different types of files with FileKitType
:
Image
: Pick an image file.Video
: Pick a video file.ImageAndVideo
: Pick an image or a video file.File()
: Pick any file. It is the default type. It’s possible to specify a list of extensions.main
function, before the application window is created.