Clay is a [[Zlib License]] licensed [[GUI Library]] written in [[C]].
- [Website](https://www.nicbarker.com/clay)
- [Source](https://github.com/nicbarker/clay)
- Documentation
> Clay (short for C Layout) is a high performance 2D UI layout library.
\- official readme[^1]
# Notability
Small-ish zero-dependency layout library. Can be used to lay out webpages too (via [[WebAssembly]]).
Supports a wide variety of [[#Renderer Support|rendering backends]] that makes it extremely interesting to me for my own [[UI Framework]] project.
Seems to be heavily recommended as an alternative to [[GUI - ImGui]].
# Philosophy
## Zero Dependencies
Not even [[libc]] or [[Memory Allocation]] and uses its own [[Arena Allocator]].
> Single ~4k LOC clay.h file with zero dependencies (including no standard library)
> ...
> Static arena based memory use with no malloc / free, and low total memory overhead (e.g. ~3.5mb for 8192 layout elements).
\- official readme[^1]
# Platform Support
# Features
## Renderer Support
- [[SDL]]v2
- [[SDL]]v3
- [[GUI - Cairo]]
- [[GUI - Raylib]]
- [[GUI - Sokol]]
- [[ANSI]] terminal
- [[HTML]] (via [[WebAssembly]])
- [[Playdate]] console
- [[Windows 3.x]]/[[Windows 9x]] [[GDI]]
## Interactive Debug Tools
Similar to the kind of tools found in a browser, if quite a bit simpler, it lets you see the structure of the layout and any error messages right in the app itself at runtime.
# Tips
# References
[^1]: https://github.com/nicbarker/clay/blob/main/README.md