Home

Awesome

Brisk

Brisk is a modern, cross-platform C++ GUI framework designed to build responsive, high-performance applications with flexibility and ease.

Initially developed for a graphics-intensive proprietary project with a complex and dynamic GUI.

[!Note] The Brisk library is currently under active development. Breaking changes may occur, and the documentation might not always be up to date. Contributions are always welcome!

Recommended reading:

➡️ Brisk Design and Feature Overview ⬅️

Documentation on docs.brisklib.com

Build License

C++ Clang 16+ GCC 12+ MSVC 2022 Xcode 14.3+

Key Features 🌟

Code Example

Component example

const NameValueOrderedList<TextAlign> textAlignList{ { "Start", TextAlign::Start },
                                                     { "Center", TextAlign::Center },
                                                     { "End", TextAlign::End } };

class Example : public Component {
public:
    RC<Widget> build() final {
        // rcnew Widget{...} is equivalent to std::shared_ptr<Widget>(new Widget{...})
        return rcnew Widget{
            layout = Layout::Vertical,
            rcnew Text{
                "Switch (widgets/Switch.hpp)",
                classes = { "section-header" }, // Widgets can be styled using stylesheets
            },

            rcnew HLayout{
                rcnew Widget{
                    rcnew Switch{
                        // Bind the switch value to the m_toggled variable (bidirectional)
                        value = Value{ &m_toggled },
                        rcnew Text{ "Switch" },
                    },
                },
                gapColumn = 10_apx, // CSS Flex-like properties
                rcnew Text{
                    text = Value{ &m_label }, // Text may be dynamic
                    visible =
                        Value{ &m_toggled }, // The Switch widget controls the visibility of this text widget
                },
            },

            // Button widget
            rcnew Button{
                rcnew Text{ "Click" },
                // Using m_lifetime ensures that callbacks will be detached once the Component is deleted
                onClick = m_lifetime |
                          [this]() {
                              // Notify bindings about the change
                              bindings->assign(m_label) = "Updated text";
                          },
            },

            // ComboBox widget
            rcnew ComboBox{
                Value{ &m_textAlignment },  // Bind ComboBox value to an enumeration
                notManaged(&textAlignList), // Pass the list of name-value pairs to populate the ComboBox
            },

            // The Builder creates widgets dynamically whenever needed
            Builder([this](Widget* target) {
                for (int i = 0; i < m_number; ++i) {
                    target->apply(rcnew Widget{
                        dimensions = { 40_apx, 40_apx },
                    });
                }
            }),
            depends = Value{ &m_number }, // Instructs to rebuild this if m_number changes
        };
    }

private:
    bool m_toggled            = false;
    TextAlign m_textAlignment = TextAlign::Start;
    std::string m_label       = "OK";
    float m_progress          = 0;
    int m_number              = 0;
};

Screenshots

<img src="docs/images/Brisk-screenshot1.png" width="400" alt="Brisk screenshot"/> <img src="docs/images/Brisk-screenshot2.png" width="400" alt="Brisk screenshot"/> <img src="docs/images/Brisk-screenshot3.png" width="400" alt="Brisk screenshot"/>

Modules

Core

Graphics

Window

GUI

Widgets

Requirements ⚙️

Platform Support

WindowsmacOSLinux
Core FunctionalityBetaBetaBeta
GraphicsBetaBetaBeta
Window SystemBetaBetaBeta
WidgetsBetaBetaBeta
Application SupportAlphaAlphaN/A

OS Support

Minimum version
WindowsWindows 10, Windows Server 2016
macOSmacOS 11 Big Sur
Linuxn/a

Graphics Backend Support

Backends
WindowsD3D11 and WebGPU (D3D12/Vulkan)
macOSWebGPU (Metal)
LinuxWebGPU (OpenGL/Vulkan)

Example Projects

The examples directory contains projects that showcase how to use the Brisk library.

For a minimal example, check out the brisk-helloworld repository.

Example Project Binary Size:

OSStatic Build, Release (Full Unicode Support)
Windows x6410.1 MB (D3D11)
Linux x6418.2 MB (WebGPU: Vulkan/OpenGL), stripped
macOS x6416.5 MB (WebGPU: Metal), stripped

These sizes do not include embedded resources (such as fonts).

Development 💻

Brisk is in active development, and we welcome contributions and feedback from the community to improve and expand the toolkit.

The main branch contains the latest features and generally passes all built-in tests ✅. Other branches are reserved for feature development and may be force-pushed.

License 📜

Brisk is licensed under the GPL v2.0 or later. However, for those who wish to use Brisk in proprietary or closed-source applications, a commercial license is also available. For more details on commercial licensing, please contact us at brisk@brisklib.com.