aicoolies logo
Clay logo
Clay logo

Clay

High-performance 2D UI layout library in C

open sourceverified Aug 24, 2026

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 100% open source under the permissive zlib License. Clay is completely free with zero licensing fees, royalties, or commercial constraints for both open-source and proprietary software development across games, desktop apps, and embedded systems.

full pricing breakdown →

Platforms

Cross-platform: C header, Wasm, any renderer

Categories

Tags

Use Cases

Related Tools

computed discovery: shared active categories · kept separate from editor-verified Alternatives

Figma logo

Figma

Collaborative design platform

Figma is the industry-standard collaborative design platform for UI/UX work, prototyping, and design systems. Runs in the browser with real-time multiplayer editing, components, auto-layout, variants, dev mode, plugins, and FigJam whiteboards. Integrates with AI design-to-code tools like Lovable, v0, Builder.io, and Anima to turn frames into production React, Vue, or iOS/Android code.

freemium
Gradio logo

Gradio

Build and share ML web apps in Python with a few lines of code

Gradio is a 42K+ star Apache-2.0 Python library for building interactive web interfaces around machine-learning functions and apps. It supports 40+ components for text, images, audio, video, 3D, chat, plots, JSON, and dataframes. Apps can be hosted free on Hugging Face Spaces, shared through public links, or extended with server-side rendering, streaming, API clients, and MCP server support.

Open Source
Magic Patterns logo

Magic Patterns

Design-system-aware AI prototyping for code-ready product interfaces

Magic Patterns turns product ideas, prompts, screenshots, and existing UI into editable, code-ready interfaces. Its design-system-aware editor supports collaborative iteration, two-way GitHub sync, and an MCP workflow for moving designs between the canvas and coding agents—positioning it between prompt-to-app builders and design-handoff tools rather than as a single-screen generator.

freemium
v0 logo

v0

Vercel's AI UI generator

Vercel's AI-powered UI generation tool that creates production-ready React and Next.js components from text or image prompts. Outputs clean code using shadcn/ui and Tailwind CSS, deployable to Vercel or copyable into existing projects. Supports iterative refinement through conversation, live browser preview, and generates accessible, responsive code. Ideal for rapidly prototyping landing pages, dashboards, forms, and UI components without manual setup.

freemium
Panda CSS logo

Panda CSS

Zero-runtime CSS-in-JS framework with type-safe style authoring

Panda CSS is a zero-runtime CSS-in-JS framework that generates atomic CSS at build time from type-safe style definitions. It provides the developer experience of CSS-in-JS with runtime performance of static CSS extraction. Supports design tokens, responsive styles, conditional variants, and recipes for component style APIs. 335K+ weekly npm downloads for @pandacss/dev with RSC compatibility.

Open Source
Puck logo

Puck

Open-source visual editor for React — self-hostable core, optional Puck Cloud

Puck is an open-source visual page builder for React that gives teams a drag-and-drop editor backed by their own components. The MIT-licensed core remains self-hostable and persists plain JSON, while Puck Cloud and Puck AI now add optional hosted and agentic editing layers. With 12.8K+ stars, it is the dev-first visual editor to watch.

freemiumOpen Source

FAQ

What is Clay?

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.

Is Clay free?

Yes — Clay is open source and free to use. Free and 100% open source under the permissive zlib License. Clay is completely free with zero licensing fees, royalties, or commercial constraints for both open-source and proprietary software development across games, desktop apps, and embedded systems.

Is Clay open source?

Yes — Clay is open source.

Is Clay still maintained?

Yes — Clay is active. Its listing was last verified on August 24, 2026.

What are the best Clay alternatives?

The top editor-verified Clay alternatives are Suspensive, TOAST UI Editor.