webview/webview logo

webview/webview

Free

Tiny cross-platform webview library for C/C++. Uses WebKit (GTK/Cocoa) and Edge WebView2 (Windows).

FreeFree tier
Type
Open Source

About webview/webview

A tiny cross-platform webview library for C/C++ that provides a common HTML5 UI abstraction layer for building modern desktop GUIs. It leverages native web engines: WebKit on Linux (GTK) and macOS (Cocoa), and Edge WebView2 on Windows. Supports two-way JavaScript bindings, allowing calling JavaScript from C/C++ and vice versa. The library is lightweight and open source, with build support via CMake and Ninja (recommended but not required). Documentation is maintained within the source code. Designed to minimize footprint by using the operating system's webview rather than bundling a full browser.

Key Features

Cross-platform support: Linux (GTK, WebKitGTK), macOS (Cocoa, WebKit), Windows (Windows API, WebView2)
Two-way JavaScript bindings (call JS from C/C++ and C/C++ from JS)
HTML5 UI abstraction layer
Lightweight and minimal footprint using native web engines
C/C++ API with C++11 minimum (C++14 on Windows)
CMake and Ninja build system support (recommended)

Pros & Cons

Pros
  • Lightweight and minimal footprint
  • Cross-platform with native performance (uses OS webview)
  • Two-way JavaScript bindings enable rich interactivity
  • Open source with active community (14.2k stars on GitHub)
  • No bundled browser, leverages existing platform web engines
Cons
  • Requires platform-specific dependencies (e.g., WebKitGTK on Linux, WebView2 on Windows)
  • Core API is C/C++ only (though language bindings exist separately)
  • Documentation primarily in source code, limited external guides
  • Windows requires C++14 and up-to-date Windows 10 SDK

Best For

Building cross-platform desktop GUIs with HTML5Embedding web views in native C/C++ applicationsPrototyping user interfaces using web technologiesIntegrating modern web content into legacy native apps

FAQ

What platforms are supported?
Linux (GTK, WebKitGTK), macOS (Cocoa, WebKit), and Windows (Windows API, WebView2).
What are the prerequisites for using this library?
Compiler supporting C++11 minimum (C++14 on Windows), CMake and Ninja recommended. Platform-specific development packages are required, e.g., libgtk-3-dev and libwebkit2gtk-4.0-dev on Debian/Ubuntu.
Does the library support JavaScript bindings?
Yes, it supports two-way JavaScript bindings: you can call JavaScript from C/C++ and call C/C++ function from JavaScript.
Is the library free and open source?
Yes, it is open source (MIT license) and free to use. The source code is available on GitHub.