aicoolies logo

Clay

High-performance 2D UI layout library in C

open-sourceopen sourceupdated Apr 12, 2026
Visit Website →
Share

Clay is a high-performance 2D UI layout library written as a single C header file that implements a flexbox-like layout model with microsecond-level performance. It uses static arena-based memory allocation with no malloc or free calls, keeping total memory usage under 4MB for thousands of elements. Clay is renderer-agnostic, outputting sorted rendering primitives that work with any 3D engine, SDL, or can compile to HTML via WebAssembly.

Clay is a minimalist yet powerful 2D UI layout library distributed as a single C header file that brings flexbox-style layout capabilities to performance-critical applications. The library processes layout calculations in microseconds using a custom algorithm that handles complex responsive layouts including text wrapping, scrolling containers, aspect ratio scaling, and nested flex containers without any dynamic memory allocation or external dependencies.

The design philosophy centers on zero-overhead abstraction: Clay uses static arena-based memory management that preallocates a fixed buffer and performs no heap allocation during layout computation. This makes it deterministic and suitable for embedded systems, game engines, and real-time applications where memory fragmentation and allocation latency are unacceptable. The API uses C macros to build UI hierarchies declaratively with modular configuration of layout properties, colors, borders, and corner radii.

Clay has rapidly gained attention in the systems programming community with over 17,000 GitHub stars since its release, appealing to developers building custom renderers and UI frameworks. The library is renderer-agnostic, outputting a sorted array of drawing primitives that can be composited with OpenGL, Vulkan, SDL, Raylib, or any graphics backend. A WebAssembly build enables browser-based usage, and the official website itself is built and rendered entirely using Clay as a demonstration of its capabilities.

Pricing

Free and open source under zlib license

Platforms

Cross-platform: C header, Wasm, any renderer

Categories

Tags

Use Cases

Alternatives

Related Tools

Mitosis logo

Mitosis

Write components once and compile them into native code for multiple frameworks

Mitosis is Builder.io-backed open-source infrastructure for writing a component once and compiling it into native framework components for React, Vue, Angular, Svelte, Qwik, Solid, React Native, and other targets. It supports cross-framework design systems and Figma-to-code synchronization, but is distinct from the Builder.io visual builder product.

open-sourceOpen Source

Figma Console MCP

Turn a Figma design system into a programmable API for AI assistants

Figma Console MCP is open-source design-system infrastructure that exposes Figma to AI assistants through MCP. It supports structured extraction, design creation and editing, debugging, accessibility audits, and bidirectional design-token workflows across local, remote read-only, and paired cloud modes; it is not a generic one-click Figma-to-code exporter.

open-sourceOpen SourceTelemetry
OpenUI logo

OpenUI

Open-source UI generation from natural-language prompts

OpenUI is an Apache-2.0 design-to-code tool from W&B that turns natural-language interface prompts into live HTML previews and frontend code. Teams can run it locally or with Docker, connect OpenAI, Groq, LiteLLM-compatible providers, or Ollama, and export generated UI toward React, Svelte, Web Components, and related workflows. It fits rapid UI mockups where developers want editable code instead of screenshots.

open-sourceOpen SourceTelemetry
Figma MCP Server logo

Figma MCP Server

Official remote MCP server for design-to-code and write-to-canvas Figma workflows.

Figma MCP Server is Figma’s official remote Model Context Protocol surface for design-to-code agents. It gives supported clients structured design context, variables, components, selected-frame code context, Code Connect mappings, and beta write-to-canvas tools for creating or updating native Figma frames from an MCP client while keeping the workflow tied to Figma files.

freemiumTelemetry
OpenPencil logo

OpenPencil

AI-native open-source design editor and Figma alternative

OpenPencil is an AI-native, open-source design editor for teams that want a Figma-like canvas with source-visible code and experimental AI design workflows. It is best framed as OpenPencil by the open-pencil project, separate from the same-name ZSeven-W repo, and useful for early UI prototyping, design-to-code exploration, and open-source visual editing pilots.

open-sourceOpen Source

Talk to Figma MCP

Read/write MCP bridge between AI coding agents and Figma

Talk to Figma MCP is an MIT-licensed bridge from Grab that connects Cursor, Claude Code, and other MCP-capable agents to Figma through a local MCP server, WebSocket bridge, and Figma plugin. Unlike read-only context servers, it can inspect selections, create or modify nodes, update text in bulk, and automate design operations, so teams should review permissions before enabling write access.

open-sourceOpen SourceTelemetry