nfd-zig is a Zig binding to the library nativefiledialog which provides a convenient cross-platform interface to opening file dialogs on Linux, macOS and Windows.
This library has been tested on Windows 10, macOS 11.1 and Linux.
You can run a demo with zig build run. The demo's source is in src/demo.zig.
If you want to add the library to your own project...
- Add the
nfddependency to yourbuild.zig.zon.{ .dependencies = .{ .nfd = .{ .path = "libs/nfd-zig" }, // Assuming nfd-zig is available in the local directory. Use .url otherwise. } } - Add the import in your
build.zig:const nfd = b.dependency("nfd", .{}); const nfd_mod = nfd.module("nfd"); exe.root_module.addImport("nfd", nfd_mod);