1
Add the dependency
FileKit can helps you to display dialogs to the user like file, directory and photo pickers, save dialogs, camera and more. FileKit dialogs are available in two flavors:Both artifacts include
filekit-core. For Compose apps, add filekit-dialogs-compose. To call the dialogs from ViewModels or non-Compose code, filekit-dialogs is enough. See Installation for every module.2
Initialize FileKit where needed
Most targets work without setup. Android (without Compose), desktop JVM, and Linux or Windows native need one line at startup.
- Android
- JVM desktop
- Linux & Windows native
- iOS, macOS, JS, Wasm
If you only use Compose launchers (
remember…Launcher), nothing to do.If you call the suspend dialog APIs (FileKit.openFilePicker()…), register your activity so FileKit can launch dialogs:MainActivity.kt
3
Pick a file
type = FileKitType.Image, FileKitType.Video, or FileKitType.File(extensions = listOf("pdf")). Pick several files with mode = FileKitMode.Multiple(). See File picker for all options.4
Read it
PlatformFile exposes the same read API on every platform. Read the file once the picker returns it: inside onResult (with scope.launch) in Compose, or after openFilePicker() returns a non-null file:file.toImageBitmap() or use Coil.5
Save a file
Ask the user where to save, then write to the returned file:
The file saver is available on Android, iOS, macOS, JVM, and Linux and Windows native, so call it from a non-web source set. Browsers don’t let you choose a save location, so on JS and Wasm use
FileKit.download(bytes, fileName) instead. See Files on the web.Where to go next
File operations
List, walk, copy, move, and delete files and folders.
Reading and writing
Text, bytes, and streaming with kotlinx-io for large files.
Gallery and camera
Native photo pickers on Android and iOS, plus camera capture.
Directories
Let users pick a folder and keep access with bookmarks.
Image utilities
Compress and resize images, and save them to the gallery.
Platform support
Check which features each platform supports.