Skip to content

saucer/saucer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation


Build cross-platform desktop apps with C++ & Web Technologies


Documentation

The documentation can be found here.

Examples

Examples can be found here.

Getting started

Learn how to create your first saucer app here.


๐Ÿ‘ฝ Introduction

Saucer is a modern C++ webview library that allows you to build cross-platform desktop applications with ease.
It supports all three major desktop operating systems (Windows, Linux, MacOS) and has several backend implementations.

๐Ÿ›ธ Features

  • ๐Ÿ’ป Cross Platform

    Windows Linux MacOS
    Backend Win32 & WebView2 GTK4 & WebKitGtk Cocoa & WKWebView
    Qt5 / Qt6 & QWebEngine
  • ๐Ÿ‘พ Feature-Rich

    Supports custom schemes, script injection, favicons, and much more!

  • ๐Ÿ”€ Seamless C++ / JavaScript interoperability

  • ๐Ÿ“ฆ Supports Embedding Frontend into binary

  • ๐Ÿชถ Lightweight

    By using the operating systems native web renderer (or a commonly used one), it is possible to create binaries as small as ~250KB

  • ๐Ÿงฐ Customizability

    Modules allow access to platform specific implementations, making it possible to tweak the library to your hearts content

    • Official Modules
      • ๐Ÿ–ฅ๏ธ saucer/desktop

        ๐Ÿ“‚ File-Picker and URI-Launch support

      • ๐Ÿ–จ๏ธ saucer/pdf

        ๐Ÿ“„ Print current page as PDF

  • ๐Ÿ—๏ธ Bindings

    Saucer also exposes a C-Interface, thus making it possible to write bindings for it in your favorite language!

  • ๐Ÿฆบ Thread-Safe

  • ๐Ÿงจ No Exceptions

    Compiles with -fno-exceptions!

  • ๐Ÿƒ No RTTI

    Compiles with -fno-rtti!

  • โš–๏ธ FOSS

    Licensed under MIT!

  • ๐ŸชŸ Built-in support for frame-less windows and transparency

  • ... and more!

โœ๏ธ Code Example

#include <saucer/smartview.hpp>

int main()
{
    auto app = saucer::application::init({
        .id = "example",
    });

    saucer::smartview webview{{
        .application = app,
    }};

    webview.set_size(900, 700);
    webview.set_title("Hello World!");

    webview.expose(
        "add_random",
        [&](float number)
        {
            auto random = webview.evaluate<float>("Math.random()").get();
            return number + random;
        },
        saucer::launch::async);

    webview.set_file("index.html");
    
    webview.show();
    app->run();

    return 0;
}

๐ŸŒ Who's using saucer?