Clay (short for “C Layout”) is a high-performance 2D UI layout library in C, offering a declarative, Flexbox-like layout model with microsecond performance. It features a single-header design, zero dependencies, and support for WebAssembly, making it lightweight yet powerful for responsive UI rendering. The Clay macro by default accepts an ID as its first argument, which is usually provided by the CLAY_ID() convenience macro. Elements can also be created with auto-generated IDs, by using the CLAY_AUTO_ID() macro. Element IDs have two main use cases. Firstly, tagging an element with an ID allows you to query information about the element later, such as its mouseover state or dimensions. Secondly, IDs are visually useful when attempting to read and modify UI code, as well as when using the built-in debug tools.

Features

  • Microsecond-level layout performance
  • Flexbox-style declarative layout with text wrapping, scrolling, and scaling
  • Single-file (~4k LOC) header-only design, no external dependencies
  • WebAssembly support—compact (~15 KB uncompressed) builds for browser use
  • Static arena memory (no malloc/free), low memory overhead even for large layouts
  • Renderer-agnostic: emits rendering primitives usable in any engine or HTML output

Project Samples

Project Activity

See All Activity >

Categories

Game Engines

License

zlib/libpng License

Follow Clay

Clay Web Site

Other Useful Business Software
Iris Powered By Generali - Iris puts your customer in control of their identity. Icon
Iris Powered By Generali - Iris puts your customer in control of their identity.

Increase customer and employee retention by offering Onwatch identity protection today.

Iris Identity Protection API sends identity monitoring and alerts data into your existing digital environment – an ideal solution for businesses that are looking to offer their customers identity protection services without having to build a new product or app from scratch.
Learn More
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of Clay!

Additional Project Details

Registered

2025-08-13