On this page

chat.h

Chat transcripts, messages, bubbles, markers, attachments, shimmer and a questionnaire, reached through isolenui/kit/kit.h.

The chat group of the kit, drawn by isolenThe chat group of the kit, drawn by isolen

#include "isolenui/kit/chat.h". The guide starts at Chat transcripts and messages.

Scroller

Explained in Chat transcripts and messages.

ui::transcriptui::scroller_optsui::scroller_stateui::scroll_openui::scroll_open_endui::scroll_open_startui::scroll_open_last_anchorui::scroll_alignui::scroll_align_startui::scroll_align_centreui::scroll_align_endui::scroll_align_nearestui::row_fnui::message_scrollerui::scroller_beginui::scroller_row_beginui::scroller_row_endui::scroller_endui_scroller_rowui::scroller_buttonui::scroller_to_messageui::scroller_to_endui::scroller_to_startui::scroller_readui::scroller_visibleui::scroller_resetui::scroll_open_message

Messages

Explained in Chat transcripts and messages.

ui::message_specui::messageui::message_beginui::message_endui_messageui::message_avatar_beginui::message_avatar_endui::message_content_beginui::message_content_endui::message_header_beginui::message_header_endui::message_footer_beginui::message_footer_endui::message_group_beginui::message_group_end

Bubbles

Explained in Chat transcripts and messages.

ui::bubble_variantui::bubble_defaultui::bubble_secondaryui::bubble_mutedui::bubble_tintedui::bubble_outlineui::bubble_ghostui::bubble_destructiveui::bubble_specui::bubbleui::bubble_beginui::bubble_textui::bubble_endui_bubbleui::bubble_group_beginui::bubble_group_end

Markers and shimmer

Explained in Chat transcripts and messages.

ui::marker_variantui::marker_defaultui::marker_borderui::marker_separatorui::marker_specui::markerui::marker_beginui::marker_iconui::marker_textui::marker_endui::shimmerui::shimmer_glyphs

Attachments

Explained in Chat transcripts and messages.

ui::attach_stateui::attach_idleui::attach_uploadingui::attach_processingui::attach_errorui::attach_doneui::attach_sizeui::attach_defaultui::attach_smui::attach_xsui::attachment_specui::attachment_hitui::attachmentui::attachment_beginui::attachment_mediaui::attachment_contentui::attachment_actionui::attachment_endui::attachment_group_beginui::attachment_group_end

Questionnaire

Explained in Questionnaire.

ui::questionui::answerui::question_statusui::question_unansweredui::question_answeredui::question_skippedui::question_keysui::question_keys_noneui::question_keys_lettersui::question_keys_numbersui::question_eventui::question_noneui::question_nextui::question_previousui::question_skipui::question_submitui::question_blockedui::questionnaire_specui::questionnaireui::questionnaire_activeui::questionnaire_reset

Example

thread.cpp
#include "isolenui/ui/ui.h"
#include "isolenui/kit/kit.h"

struct turn {
    const char* text;
    bool mine;
};

struct thread {
    uint64_t ids[4096];
    uint8_t anchors[4096];
    turn turns[4096];
    uint32_t count = 0;
    uint64_t revision = 0;
    uint64_t next_id = 1;
};

// the arrays must stay put until the next frame reads them again
static void send(thread* t, const char* text, bool mine)
{
    const uint32_t i = t->count++;
    t->ids[i] = t->next_id++;
    t->anchors[i] = mine ? 1u : 0u;
    t->turns[i] = turn{ text, mine };
}

static void row(ui::ctx* u, uint32_t i, void* user)
{
    const turn& m = static_cast<thread*>(user)->turns[i];
    ui::message(u, m.text, m.mine ? nullptr : "helper", nullptr, m.mine,
                m.mine ? ui::bubble_default : ui::bubble_secondary);
}

static void chat(ui::ctx* u, thread* t)
{
    ui::transcript tr = {};
    tr.ids = t->ids;
    tr.anchors = t->anchors;
    tr.count = t->count;
    tr.revision = t->revision;

    // a new mine row pins at the top and the reply grows under it
    ui::scroller_opts o = {};
    o.peek = 48.0f;
    ui::message_scroller(u, "thread", tr, row, t, o);
}

Last updated 23 October 2026