PrimitivesSelect & inputAi field action
Ai field action
The "ask Joey to write this field" action: a small split pill carrying Joey's sparkles, on a strip across the foot of a text field, inside the field's own box.
AI field action
The "ask Joey to write this field" pill, inside the field's own box. The calling page decides
what the request means and applies its result, so the same component serves a document summary,
an enquiry reply, a note or a message. Wrap field and pill in a relative container and leave the field
enough bottom padding (pb-11) for the pill to sit over. Every use gets an
Undo: replacing what someone typed with no way back is how an AI feature loses trust.
API
for
string — DOM id the caller uses when handling intent and undo.x-on:koala-ai-field-intent
Alpine expression — owns the request, field mutation and presentation state.x-on:koala-ai-field-undo
Alpine expression — owns restoring the previous value.write-label
string — What the pill says, and does, while the field is empty.polish-label
string — What the pill says, and does, once the field has text in it.rewrite-label
string — What the pill says when the field already holds a sentence.ai-authored
bool — True when the value this field renders with is JOEY'S own prose, unedited since he wrote it.has-text
bool — True when the field already holds text as the page renders.has-text-expression
string? — Bound Alpine expression for whether the field has text.ai-authored-expression
string? — Bound Alpine expression for provenance.undo-available-expression
string? — Bound Alpine expression for caller-owned undo availability.busy-expression
string? — Bound Alpine expression for caller-owned request progress.error-expression
string? — Bound Alpine expression for caller-owned error copy.offer-polish
bool — Drop the caret and offer only "write it for me" — for a field whose content is never the reader's own prose…busy-label
string? — Pin what it says while it works.placement
AiFieldActionPlacement — Where the control sits.class
string?