# nicbarker/clay

High performance UI layout library in C.

Repository: https://github.com/nicbarker/clay
Canonical: https://ross.abutalabs.com/products/clay
Homepage: https://nicbarker.com/clay
Language: C
License: Zlib
License Family: permissive
Topics: layout, ui
Last push: 2026-05-20T02:17:59+00:00

## Health v2 (maintenance only)
Score: 54/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 83, release rhythm 16, longevity 55
- inputs: {"age_days": 774, "days_push": 106, "days_rel": 454, "gap_med": 112, "n_releases_24m": 4}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 17998, forks 715 (observed 2026-08-28T04:11:20.811319+00:00)

## What it is
Clay is a high-performance 2D UI layout library in C, distributed as a single zero-dependency header file. It provides a flex-box-like declarative layout model that outputs renderer-agnostic rendering primitives, with support for compiling to WebAssembly for browser use.

## Use cases
- build game UI layouts in C or C++
- create responsive flexbox-style layouts without a browser engine
- compile a UI layout engine to wasm for the browser
- lay out native desktop application interfaces
- avoid malloc and heap allocation in embedded UI code
- render UI with any custom renderer or 3D engine

## When to choose
- you need microsecond-level layout performance in C/C++
- you want a single-header, zero-dependency layout solution
- you're building UI for games or custom renderers and need renderer-agnostic primitives
- you need wasm support with a tiny binary footprint

## When to avoid
- you need a full widget toolkit with built-in controls, theming, or input handling
- you want immediate-mode GUI rather than retained declarative layout
- your project is not in C/C++ or a language with C FFI
- you need accessibility features or native platform widgets

## Facets
- artifact type: library
- maturity: active
- function: ui-components, graphics
- domain: graphics, web-development, cross-platform
- platform: cpp, c, wasm, cross-platform, browser
- tags: flexbox-layout, single-header, zero-dependencies, renderer-agnostic, declarative-ui, immediate-mode-adjacent, game-ui, layout, game-development, desktop

## Member repositories
- nicbarker/clay (main) score 54

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:11:20.811319+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T17:02:11.533720+00:00, confidence not recorded.
  - readme: https://github.com/nicbarker/clay (fetched 2026-08-28T04:11:20.811319+00:00, sha c9a8a3f2e38f)
  - homepage: https://nicbarker.com/clay (fetched 2026-08-29T08:00:17.083000+00:00, sha cbb8d0a2b258)
- Data as of 2026-08-30T08:39:29.467469+00:00.
