explaingit

facebook/yoga

Analysis updated 2026-06-21

18,728C++Audience · developerComplexity · 4/5Setup · hard

TLDR

Yoga is a C++ layout engine from Meta that lets native mobile and desktop apps use the same flexbox layout rules as web browsers, making UI positioning consistent and predictable outside the browser.

Mindmap

mindmap
  root((yoga))
    What it does
      Flexbox layout
      Browser-compatible rules
      Cross-platform UI
    Tech Stack
      C++
      Language bindings
    Use Cases
      UI frameworks
      Native app layout
    Testing
      Chrome HTML fixtures
      Browser verification
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 a cross-platform UI framework for mobile or desktop that arranges components with the same flexbox rules web browsers use.

USE CASE 2

Embed consistent, predictable layout calculation into a native app without bundling a full browser engine.

What is it built with?

C++

How does it compare?

facebook/yogaid-software/doomrizinorg/cutter
Stars18,72818,69618,764
LanguageC++C++C++
Setup difficultyhardhardmoderate
Complexity4/55/53/5
Audiencedeveloperdeveloperdeveloper

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

How do you get it running?

Difficulty · hard Time to first run · 1day+

Designed to be embedded inside a UI framework as a library, not used standalone, the main effort is integrating it into your own rendering pipeline.

In plain English

Yoga is a layout engine, a piece of software that calculates where things should appear on screen, built to follow the same rules web browsers use for their flexbox layout system. Flexbox is the standard approach for arranging boxes, rows, and columns in modern user interfaces. Yoga lets developers use these same familiar layout rules in applications outside the browser, such as native mobile or desktop apps. The library is written in C++ and can be embedded into apps built in other languages through bindings. Its tests are generated from HTML fixtures that are rendered in Chrome to confirm the expected positions, so the output closely matches real browser behavior. Yoga is primarily useful for developers building cross-platform UI frameworks who want consistent, standards-based layout behavior without depending on a web browser at runtime.

Copy-paste prompts

Prompt 1
I'm building a cross-platform UI framework and want to use Yoga for layout. How do I integrate the C++ library and call it to calculate positions for a flex container with three children?
Prompt 2
Show me how to set up a Yoga flexbox layout with rows, columns, and percentage widths using the C++ API.
Prompt 3
How does Yoga's test suite use Chrome HTML fixtures to verify layout output? Walk me through adding a new test case for a layout I need.
Prompt 4
Help me understand how Yoga implements flexbox wrap and align-content, I want to port those behaviors to a custom renderer.

Frequently asked questions

What is yoga?

Yoga is a C++ layout engine from Meta that lets native mobile and desktop apps use the same flexbox layout rules as web browsers, making UI positioning consistent and predictable outside the browser.

What language is yoga written in?

Mainly C++. The stack also includes C++.

How hard is yoga to set up?

Setup difficulty is rated hard, with roughly 1day+ to a first successful run.

Who is yoga for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Scan in gitsafehub Deploy in gitdeployhub facebook on gitmyhub

Verify against the repo before relying on details.