Variants and sizes

  • Default (k-field, k-field__input): 48px (size-control-lg), for phones and roomy web forms.
  • Amount (k-field__input--mono): font-mono with tabular figures, so 12.50 and 241.86 line up; the unit goes in the label, "Amount (R$)".
  • Multiline (textarea.k-field__input): at least 96px tall; the person can drag it taller.
  • Compact (k-field--compact): 40px (size-control-md), for dense web forms only.
  • Error (k-field--error): see States.

States

  • Rest: a 1px outline border on surface. Hover changes only the cursor.
  • Focus: a 2px focus-ring ring 1px outside, and an ink border. It shows on every focus, pointer or keyboard, since typing goes there.
  • Filled: the value in ink replaces the placeholder.
  • Error: a 2px critical border, and the helper line becomes the message in critical, after the error icon. Never red alone: about 1 in 12 men has a colour vision deficiency, and in dark mode critical is a pale pink, so the error also thickens the border, adds a shape and says the fix: "Enter an amount, like 12.50". It is critical, never negative, so a broken field can't read as a debt.
  • Disabled: don't disable a field; show a fixed value as text and say why.

Do and don’t

Do

  • Keep the label above the field, visible while the person types.

  • Use the placeholder for an example value, like "Coffee with Ada".

  • Write the error as the fix: "Enter an amount, like 12.50", not "Invalid value".

Don’t

  • Put rules or instructions in the placeholder; use helper text.

  • Flag an error while the person is still typing; check on leaving the field or on save.

  • Use compact fields on phones.

What you provide

  • Label (required) and an id; the value; a placeholder example (optional).
  • Helper text (optional), and the error message when the value is invalid.
  • Input type and inputmode; multiline or compact.