Wrapping long words?
Author: abzalmyrzashCreated Feb 27, 2026Updated Jul 31, 2026
As far as I can see, there are only three wrap modes:
// Controls how text "wraps", that is how it is broken into multiple lines when there is insufficient horizontal space.
typedef CLAY_PACKED_ENUM {
// (default) breaks on whitespace characters.
CLAY_TEXT_WRAP_WORDS,
// Don't break on space characters, only on newlines.
CLAY_TEXT_WRAP_NEWLINES,
// Disable text wrapping entirely.
CLAY_TEXT_WRAP_NONE,
} Clay_TextElementConfigWrapMode;CLAY_TEXT_WRAP_WORDS works fine when words are short but when any word is longer than the width of the container it goes outside. For example:
So, could you implement a wrap mode where text breaks on the last character that fits in the container?
Source: nicbarker/clay