Skip to main content
Cayuse Design System Lato · 4pt grid · WCAG 2.1 AA

Components · Inputs

Text Input

A single line of free text. The most-used control in the suite, and the one whose states the rest of the input family follows.

Figma source: Text Input ↗

Examples

Label, help text, and a required field
Enter the number exactly as it appears on the sponsor’s notice of award.
html
<div class="cds-field">
  <label class="cds-field__label" for="award">
    Sponsor award number<span class="cds-field__required" aria-hidden="true">*</span>
  </label>
  <input class="cds-input" id="award" type="text" required
         aria-describedby="award-help" placeholder="e.g. R01-GM-123456">
  <span class="cds-field__caption" id="award-help">
    Enter the number exactly as it appears on the sponsor's notice of award.
  </span>
</div>
Live validation — blur the field while it is empty
html
<!-- Validation fires on blur, and clears as soon as the value is fixed -->
<input class="cds-input" id="pi" type="text" required aria-describedby="pi-err" aria-invalid="false">
<span class="cds-field__error" id="pi-err" hidden>Enter the principal investigator's name.</span>

States

State matrix
Default, blank
Placeholder
Entered
Focus
Error
Disabled
The placeholder-and-error rule, straight from the Figma annotations

The Figma file states it twice, for Text Input and again for Combobox: “No variant for error state with placeholder. Errors would only occur on inputs that have already had text.” and “No variant for focus state with placeholder. If user focuses on inputs, placeholder text is removed.”

That is correct behaviour, not a gap in the component set. A placeholder is visible only while the field is empty and unfocused; the moment it is focused or filled, the placeholder is gone, so a placeholder can never coexist with a focus ring or an error message.

Figma properties

PropertyValuesNotes
StateDefault · Focus · Disabled · ErrorThe four runtime states.
Text TypeBlank · Placeholder · EnteredWhat the field currently contains.
Show Icon?booleanA leading Font Awesome glyph.
Icon code (fa)textThe glyph name, e.g. search.
Placeholder CopytextFormat hint shown while blank and unfocused.
Input TexttextThe entered value.

Usage

When to use it

  • Use for short, free-form, single-line text — names, titles, identifiers.
  • Size the field to the expected content: a five-character code should not sit in a 400px box.
  • Use type to get the right mobile keyboard and browser validation — email, tel, url.
  • Put format requirements in persistent help text, not the placeholder.

When not to use it

  • Do not use for more than one line of text — use a Text Area.
  • Do not use for a value chosen from a known set — use a Select or Combobox.
  • Do not use the placeholder as the label.
  • Do not validate on every keystroke; it flags errors before the user has finished typing.
A placeholder is not a label

Placeholder text disappears the moment the user types, taking the field’s only description with it — which breaks anyone relying on short-term memory, anyone interrupted mid-form, and anyone reviewing their answers before submitting. It also sits at --input-caption grey, which is deliberately low-emphasis.

Every field needs a persistent <label>. Use the placeholder only for a format hint that supplements the label — never to replace it.

Accessibility

  • Every input needs a <label for> matching its id. A visually hidden label is acceptable where the layout truly cannot carry one; no label is not.
  • Bind help text and error text with aria-describedby so both are announced with the field.
  • Set aria-invalid="true" when the field is in error, and back to false when fixed.
  • The asterisk is decorative — aria-hidden="true" — with the real required attribute carrying the meaning.
  • Error text is 12px. It must never be the only signal: the border also thickens to 2px and turns red.

Tokens consumed

TokenApplied toResolves to
--input-backgroundField fill--color-white
--input-borderResting border--color-gray-400 → #888c8c
--input-textEntered value--color-black → #111111
--input-focus-borderFocus ring--focus-ring → #44a3db ⚠
--input-error-backgroundFill in error--color-red-100
--input-error-borderBorder in error--color-red-500
--input-disabled-backgroundFill when disabled--color-gray-100
--input-disabled-textValue when disabled--disabled-text → #888c8c
--input-labelLabel--color-black
--input-requiredRequired asterisk--color-red-500
--input-captionHelp text and placeholder--color-gray-500
--input-error-captionError message--color-red-500