Home

Awesome

Brisk

Brisk is a modern, cross-platform C++ GUI toolkit focused on building responsive, high-performance applications with flexibility and ease.

🚧 The Brisk library is currently under active development and will remain in the Alpha stage for the next few releases. After that, it will transition to Beta. During this period, there may be breaking changes, and the documentation may not always be up to date.

Build License Status

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,
            new Text{
                "Switch (widgets/Switch.hpp)",
                classes = { "section-header" }, // Widgets can be styled using stylesheets
            },

            new HLayout{
                new Widget{
                    new Switch{
                        // Bind the switch value to the m_toggled variable (bidirectional)
                        value = Value{ &m_toggled },
                        new Text{ "Switch" },
                    },
                },
                gapColumn = 10_apx, // CSS Flex-like properties
                new 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
            new Button{
                new 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
            new 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(new 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 SystemAlphaAlphaAlpha
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.

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.