aicoolies logo

Clay

High-performance 2D UI layout library in C

Share
open-sourceOpen Source
Visit Website →

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

screenshot-to-code

Convert any screenshot or mockup into clean frontend code with AI vision.

screenshot-to-code is an open-source tool that converts screenshots, mockups, and Figma designs into clean, functional HTML, Tailwind CSS, React, or Vue code using AI vision models. Powered by GPT-4V, Claude, and Gemini, it supports video-to-code and iterative editing workflows, making it a rapid scaffolding tool for frontend developers who want to skip the pixel-translation step entirely.

open-sourceOpen Source
Puck logo

Puck

Open-source visual editor for React — your components, drag-and-drop, no vendor CMS

Puck is an open-source visual page builder for React that gives marketing teams a drag-and-drop editor backed by your own components — no vendor CMS, no proprietary runtime, just your components rendered in a visual canvas. With 12,500+ stars, MIT license, and a small but active team at Measured Co., Puck has become the default self-hosted answer for React-native visual editing.

free
blender-mcp logo

BlenderMCP

Connect Blender to AI through Model Context Protocol

BlenderMCP bridges Blender and AI assistants like Claude through the Model Context Protocol, enabling natural language control over 3D modeling workflows. Artists and developers can create, modify, and manipulate 3D scenes, objects, materials, and animations by describing what they want instead of navigating complex menus. The tool exposes Blender's Python API through MCP, supporting operations from mesh creation to shader editing and physics simulations.

freeOpen Source

Sandpack

Component toolkit for live code playgrounds

Sandpack is a component toolkit by CodeSandbox for building live-running code editing experiences directly in the browser. It bundles a full in-browser JavaScript bundler, CodeMirror editor, and preview pane into embeddable React components with npm dependency support, hot module reloading, and error overlays. Sandpack powers the interactive examples on the official React documentation and supports templates for React, Vue, Svelte, and vanilla JavaScript.

open-sourceOpen Source

Refine

React meta-framework for enterprise CRUD apps

Refine is an open-source React meta-framework for building data-intensive enterprise applications like admin panels, dashboards, and internal tools. Its headless architecture separates business logic from UI, supporting Ant Design, Material UI, Mantine, and Tailwind CSS. Connects to 15+ backends including REST, GraphQL, Supabase, Firebase, Strapi, and Hasura with built-in authentication and role-based access control. Deploys on Next.js, Remix, React Native, and Electron.

open-sourceOpen Source
CopilotKit logo

CopilotKit

Full-stack framework for building AI copilots with generative UI

CopilotKit is an open-source full-stack framework for building AI-native applications with generative user interfaces. It provides React and Angular SDKs that enable agents to dynamically generate and render UI components, synchronize state between frontend and backend in real time, and implement human-in-the-loop workflows. Supports integration with LangChain, LangGraph, CrewAI and protocols including AG-UI, MCP, and A2A for standardized agent interaction.

freemiumOpen Source