Koala logo Design
No matches for “
↑↓ navigate open Esc close
PrimitivesSelect & inputField & input

Field & input

Free text entry. The bare styled input/textarea (asp-for) is the primitive; koala-field composes it into label + input + validation. Use koala-select for choosing one value.

<koala-field>

Bare input

asp-for (styled automatically)

Field (label + input + validation)

type="email" input-prefix="Email"

Label, prefix & inline validation

koala-label + koala-input-prefix + koala-inline-validation-for

File upload

accept=".pdf,.docx" max-size-mb="10"

Date picker

optional

States

Default
Focus
Error
Disabled

AI field action

The "ask Joey to write this field" pill, inside the field's own box. The endpoint decides what it means: with an empty field it writes one from scratch, with text in it it rewrites what is there — 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.

Ask Joey

AI credit

Says the assistant wrote what is in the field, and that nobody has touched it since. Muted on purpose: a tray can carry several at once, and in the accent colour they read as a row of things to press and crowd out the controls that genuinely are. The accent means clickable; provenance recedes. Bind the x-show the field already computes so the credit goes the moment someone starts typing — not when they save.

by Joey
by Joey

Label row

The label AND the line it sits on. Whatever the field offers beside its label — Joey's credit, a "Choose for me" button, a thinking indicator — is the row's content and lands at its right-hand end. The line is fixed at a 28px floor with its contents centred, so swapping the button for the shorter indicator cannot move the label, and a field with something beside its label sits on the same line as the plain field above it. Never write that row, its height, or the label's bottom margin at a call site (LAYOUT-10).

Label, credit and an action on one line
by Joey

Sits 6px under the control, whichever page it is on.

API

for Model expression (koala-field)
label string (koala-field)
type textemailtelnumberpassword (koala-field)
placeholder string (koala-field)
autocomplete string (koala-field)
required bool (koala-field)
optional bool (koala-field)
disabled bool (koala-field)
input-prefix NoneEmailPhoneCurrency (koala-field)
inputmode string (koala-field)
min / max / maxlength stringstringint (koala-field)
helper-text string (koala-field)
koala-input-prefix NoneEmailPhoneCurrency (raw input)
koala-input-suffix NonePercentage (raw input)
koala-inline-validation-for Model expression (wrapping div)
name string (koala-file-upload)
accept MIME list (koala-file-upload)
multiple bool (koala-file-upload)
max-size-mb int (koala-file-upload)
for Model expression (koala-date-picker)
min / max yyyy-MM-dd (koala-date-picker)
for DOM id of the field to write into (koala-ai-field-action)
action URL that answers { ok, text } (koala-ai-field-action)
label / busy-label string (koala-ai-field-action)
for Model expression (koala-field-label)
for-id DOM id of an unbound control (koala-field-label)
label string (koala-field-label)
required / optional bool (koala-field-label)
class string (koala-field-label, koala-field-hint)