Skip to content

saucer/saucer

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.

Community

Get in touch: Discord, Matrix

Mirrors

Saucer is available on: GitHub, Codeberg


πŸ‘½ 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

✍️ Code Example

#include <print>
#include <saucer/smartview.hpp>

coco::stray start(saucer::application *app)
{
    auto window  = saucer::window::create(app).value();
    auto webview = saucer::smartview<>::create({.window = window});

    window->set_title("Hello World!");
    window->set_size({.w = 800, .h = 600});

    webview->expose("add_demo", [&](double a, double b) -> coco::task<double>
    { 
        co_return a + b + co_await webview->evaluate<double>("Math.random()"); 
    });

    auto index = saucer::url::from("index.html");

    if (!index.has_value())
    {
        co_return std::println("{}", index.error());
    }

    webview->set_url(index.value());
    window->show();

    co_await app->finish();
}

int main()
{
    return saucer::application::create({.id = "example"})->run(start);
}

πŸ” See more examples!

🌐 Who's using saucer?

Casterlabs - Caffeinated TopNotify
(Built on saucer4j) (Built on their C# Saucer Bindings "IgniteView")

πŸŽ‰ Become part of this list!

⭐ Star History

🍡 Buy me a tea!

Saucer is a passion project and I develop it in my free-time. If you'd like to support me, consider sponsoring my tea-addiction πŸ«‚


Saucer is 100% human written. No AI-Tools were used in the development process.

Footnotes

  1. ... or a commonly used one ↩

  2. For lack of a better word ↩