explaingit

cycfi/elements

Analysis updated 2026-07-03

3,687C++Audience · developerComplexity · 4/5LicenseSetup · moderate

TLDR

Elements is a lightweight C++ library for building desktop app interfaces in pure C++ code, with no markup files needed, designed to embed easily into audio plugins and existing apps.

Mindmap

mindmap
  root((elements))
    What it does
      GUI library
      C++ code-based UI
      Resolution independent
    Key features
      Embeddable
      No event loop ownership
      Audio plugin support
    Tech stack
      C++
      Cairo rendering
      Skia backend
    Use cases
      Desktop app UI
      VST AU plugins
      Lightweight controls
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Build the graphical controls (knobs, sliders, buttons) for a VST audio plugin in C++ without taking over the host's event loop.

USE CASE 2

Add a lightweight UI to an existing C++ application without replacing the existing framework.

USE CASE 3

Create resolution-independent desktop UI components that scale correctly on high-DPI displays.

USE CASE 4

Describe a full desktop app interface entirely in C++ code with no separate XML or markup files.

What is it built with?

C++CairoSkiaCMake

How does it compare?

cycfi/elementskde/kdeconnect-kdeaudiorouterdev/audio-router
Stars3,6873,6883,685
LanguageC++C++C++
Setup difficultymoderatemoderateeasy
Complexity4/53/52/5
Audiencedeveloperdevelopergeneral

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · moderate Time to first run · 1h+

Requires CMake and either Cairo or Skia development libraries, API is still changing as the project has not reached v1.0.

MIT, use freely for any purpose including commercial, just keep the copyright notice.

In plain English

Elements is a C++ library for building graphical user interfaces, meaning the windows, buttons, sliders, and other visual controls that make up a desktop application. It is written for developers who work in C++ and want to describe their interface directly in code rather than using a separate visual editor or markup file. The interface description language is built into C++ itself, so there is no separate configuration file format to learn. The library is designed to be lightweight and modular. It can be dropped into an existing application alongside other UI frameworks rather than taking over the whole program. This makes it suitable for building audio plugins in formats like VST or AU, where the plugin runs inside a host application that already controls the event loop. Elements does not need to own the event loop itself, which is what allows this kind of embedding. The library handles resolution independence, meaning interfaces built with it scale correctly across displays with different pixel densities without extra work from the developer. The rendering backend is currently Cairo-based, with a Skia-based alternative still in active development. Elements is not yet at version 1.0 and the README notes the API is still changing, so it is not considered production-ready. The author describes it as usable and welcomes bug reports and contributions. Documentation is partially available covering setup, layout, and design concepts, with more still in progress. A Discord server is available for questions and discussion. The project is created and maintained by Joel de Guzman, who also authored several well-known C++ libraries in the Boost collection. Elements is released under the MIT license.

Copy-paste prompts

Prompt 1
I'm building a VST plugin in C++ and want to add a custom knob and slider UI using cycfi/elements. Walk me through integrating it into a plugin that runs inside a host application.
Prompt 2
Show me a minimal C++ example using cycfi/elements that creates a window with a button and a slider, and responds to button clicks.
Prompt 3
How does cycfi/elements handle high-DPI displays? Show me how resolution independence works in practice with a concrete layout example.
Prompt 4
Help me set up the cycfi/elements build with CMake on Linux, choosing the Cairo backend, and run the example projects.
Prompt 5
What are the layout primitives in cycfi/elements for arranging controls horizontally and vertically, and how do I nest them?

Frequently asked questions

What is elements?

Elements is a lightweight C++ library for building desktop app interfaces in pure C++ code, with no markup files needed, designed to embed easily into audio plugins and existing apps.

What language is elements written in?

Mainly C++. The stack also includes C++, Cairo, Skia.

What license does elements use?

MIT, use freely for any purpose including commercial, just keep the copyright notice.

How hard is elements to set up?

Setup difficulty is rated moderate, with roughly 1h+ to a first successful run.

Who is elements for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Scan in gitsafehub Deploy in gitdeployhub cycfi on gitmyhub

Verify against the repo before relying on details.