Clay is a header-only layout engine designed for C and C++ applications that computes element positions and dimensions using a declarative box model. By operating as an immediate-mode framework, it calculates interface geometry dynamically on every frame, allowing for the creation of responsive and fluid user interfaces without maintaining persistent state.
The library functions as a platform-agnostic tool that decouples layout logic from specific graphics backends. It provides a flexible coordinate system that supports layered elements, such as modals and tooltips, alongside standard document flow. This abstraction allows developers to integrate the engine into any rendering environment while maintaining consistent visual scaling across different display configurations.
The engine includes built-in support for interactive features, including pointer input tracking, scrollable containers, and state-driven layout interpolation for smooth visual transitions. It also provides diagnostic tools to visualize element boundaries and hierarchies during development. The entire implementation is distributed as a single header file to facilitate integration into existing projects.