Skip to content

theseyan/bunview

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


bunview


Feature-complete webview bindings for Bun

Example Image

Bunview is a cross-platform library to build web-based GUIs for desktop applications.

Installation

bun add bunview

Linux Prerequisites

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

Usage

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.

Limitations

  • Setting MIN and MAX window size hints on macOS does not work, you must use either FIXED or NONE
  • Window.init to inject Javascript preload does not work correctly on macOS

Building from source

Bunview is written in Zig and compilation is fairly straightforward. The prerequisites are:

# 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