Bunview is a cross-platform library to build web-based GUIs for desktop applications.
bun add bunview
The GTK and WebKit2GTK libraries are required for development and distribution. You need to check your package repositories regarding how to install those.
On Debian-based systems:
- Packages:
- Development:
apt install libgtk-3-dev libwebkit2gtk-4.0-dev
- Production:
apt install libgtk-3-0 libwebkit2gtk-4.0-37
- Development:
import {Window, SizeHint} from "bunview";
let window = new Window(true);
window.on('ready', () => {
window.setTitle('Bunview');
window.navigate("https://bun.sh");
});
There is no documentation right now, hence the best place to start is examples.
- Setting
MIN
andMAX
window size hints on macOS does not work, you must use eitherFIXED
orNONE
Window.init
to inject Javascript preload does not work correctly on macOS
Bunview is written in Zig and compilation is fairly straightforward. The prerequisites are:
- Zig version 0.11.0-dev.944+a193ec432
# Clone the repository and update submodules
git clone https://github.com/theseyan/bunview && cd bunview
git submodule update --init --recursive
# Build
zig build -Drelease-fast
# Move to build/ folder. Your binary name will differ based on OS/CPU.
mkdir build && mv zig-out/bin/bunview-x86_64-linux ./build/bunview-x86_64-linux
# Run example (must have Bun installed)
bun examples/main.js