# Input Text: Labels, States, and Clear Errors for Every Text Field

> Learn how one reusable text input keeps its label, help text, states, and error messages clear for every user.

**In short:** A text input in a design system is one reusable field with a label, help text, defined states and clear error messages, so every user knows what to type.

From "Design systems", a free course by Venkat R. Murty: https://designervenkat.online/learn/design-systems/input-text

## What you will learn

A text input is the box where a person types a short piece of free-form text, such as a name, an email address, or a search term. In a design system, it is a reusable component: one shared part that every team uses the same way. Learn it once and you can use it on sign-up pages, settings pages, and search bars.

This lesson covers the parts that make up a text input (its anatomy), the states it must define, and how to choose the right input type, check the value, and write helpful error messages.

- **Text input:** A box where a user types one line of free-form text.
- **Label:** The short name above a field that says what to enter, such as Email address.
- **Placeholder:** Faint text shown inside an empty field. It disappears once the user starts typing.
- **Helper text:** Extra guidance below the field that explains the rules or gives an example.
- **Error message:** Text that tells the user a field has a problem and how to fix it.
- **State:** A visual form a component takes in a certain situation, such as when it is empty, focused, or wrong.
- **Focus indicator:** A visible mark, often a thick outline, that shows which field the keyboard or cursor is in.
- **Validation:** A check that the typed value follows the rules, such as having an @ sign in an email.
- **Input type:** The kind of data a field expects, such as email, number, or password.

Read in order. The worked example near the end ties the ideas together on one email field.

## What is an input text?

A bare input box only gives people a place to type. It does not tell them what to enter or check what they typed. A text field is the input plus its context: a label, guidance, and feedback. In this course, the reusable piece is that full pattern, so every form looks and behaves the same.

## What is the anatomy of a text input?

Most design systems name the same core parts. Each part has one job. Learn these five names first, because later rules refer to them.

- **Label:** Names the information the user should enter. It stays on screen the whole time, even while the user types. It sits above the field.
- **Field container:** The visual box around the place where text goes. It shows the border that changes with each state.
- **Placeholder:** A short hint inside the empty box, such as an example like name@example.com. It is not a label and vanishes once typing begins.
- **Helper text:** Extra guidance placed below the field. Use it for rules, such as a required format, or for the reason the user needs to give the information.
- **Error message:** Feedback near the field when the value is wrong. It explains the problem and how to fix it, and usually sits below the field.

Some systems add extras, such as a required mark or an icon at the edge of the field. The five parts above are the core. Do not rely on color alone to show a problem. Add a text message and, often, an icon, because some people cannot see color well.

Some guides place errors above the field, so they stay visible when autofill (the browser's list of saved answers) covers the area below. Most guides still place errors below. This course follows the common pattern and keeps each error next to the field it describes.

Keep the label short and specific, and put longer explanations in helper text. Keep the label visible at all times. A label that disappears forces people to remember what the field was for. Place labels above the box, because people read the name first and then the box. This also works well on small phone screens.

Every field also needs a name that a screen reader can read. A screen reader is software that reads the page aloud for people who cannot see it well. Link the label, helper text, and error to the field, so they are read together.

### Why must a placeholder never replace a label?

The placeholder looks tidy, so many new designers use it instead of a label. Design systems warn against this. Once the user types, the field has no name. In a long form, a user who fills in one box and moves to the next can forget which box was which, and a vanished placeholder cannot help them.

> **Tip:** Use the placeholder only for an example, like name@example.com. Keep the real name in a label above the box.

## What states must every text input define?

A state is one visual form a component takes in one situation. A text input changes as the user moves through a form. Define each state in advance, so the component never looks random.

- **Default:** The normal look before anyone touches the field.
- **Hover:** The look when a mouse pointer rests over the field. It is a white box with an outline that is slightly thicker at the bottom.
- **Focus:** The look when the user clicks into the field or tabs into it. The focus indicator appears here.
- **Filled:** The look once the field holds a value. The label stays visible.
- **Disabled:** The look when a field exists but cannot be used right now. It looks muted but stays visible.
- **Read-only:** The value is visible and can be read or selected, but cannot be changed.
- **Error:** The look when the value breaks a rule. The border changes, and the error message appears near the field.
- **Success:** The look when the value is valid. A small check mark can confirm it.

Not every product uses every state on every field, but the component should define all of them. States must follow user actions. Do not invent a red field just to make a page feel urgent.

### What is the visible focus indicator?

The focus indicator tells the user which field is active. Without it, a person using a keyboard cannot see where they are. A common look is a thick outline in a color that stands out from the page.

> **Tip:** Make focus stronger than hover. Hover is a hint, while focus says typing will go into this box. Press the Tab key through your form, which moves focus from field to field, and check that you can always see where you are.

### Disabled versus read-only

Disabled and read-only look similar, but they differ. A disabled field exists but is unavailable right now, and it cannot accept input. A read-only field shows a value the user can review but not change, and the user can still focus on it. Ask one question: can the user change this value? If no, and the value matters, use read-only. If the field does not apply yet, use disabled.

## Choosing the right input type

The input type sets the kind of data a field expects. It shapes the keyboard, the hints, and the checks. Choose the type that matches the answer.

- **Plain text:** For names, search terms, and other free words. Use it when no other type fits.
- **Email:** For an email address. An email type lets the field catch a missing @ sign or domain, which an open text box does not.
- **Number:** For amounts, such as the number of items in a cart. It accepts digits only.
- **Password:** For secret values. The characters are hidden as the user types. It still needs a visible label.

> **Tip:** Ask what kind of answer the field needs before you pick a look. Do not use plain text for everything.

## When to check what the user typed

Validation means checking that the value follows the rules. The timing changes how the form feels. Check too early and the user sees errors before finishing. Check too late and the user fills in a whole form before learning that field one is wrong.

- **While typing:** Avoid showing errors here. A message about a bad value can appear before the person has finished. Hints about rules are fine, but failures should wait.
- **When focus leaves the field:** The most common choice. The user has finished the box, and the feedback appears right where they were.
- **On submit:** For long forms, many teams check everything when the user presses submit, with a summary at the top.

> **Tip:** Choose one timing rule for the whole component and write it down. Users learn the pattern once and trust it on every form.

## Writing error messages that help

An error message is the most important text in a text input. It should say what is wrong and how to fix it, in short plain words.

- **Be specific:** 'An error occurred' tells the user nothing. Name the exact problem.
- **Say how to fix it:** Show the correct form, such as a pattern or example. The message should guide the next action.
- **Do not blame:** 'You entered an invalid email' adds blame without help. Describe what the field needs instead.
- **Skip the word error:** The red border and icon already signal a problem. Start with the fix.

A good email error reads: 'Enter a valid email like name@example.com.' It names the field, says what is needed, and gives a real example. 'Invalid email' says the box is wrong but not how to correct it.

Keep one message per field, and show it next to the box it describes. Keep the layout steady: the error can replace the helper text instead of adding a new line, so the form does not jump.

Know the difference between a field problem and a system problem. A wrong email format belongs to the field. A failed connection to the server, the computer that stores the data, needs its own message at the top. Do not mark a correct email as wrong because the server is down.

> **Tip:** Read each error out loud. If it sounds like a scolding, rewrite it. If it tells the user exactly what to change, keep it.

### Error summaries for long forms

On a long form, an error summary is a short list at the top that names every field with a problem. Each item links to its field, so the user can jump to the fix. Use the summary with inline messages, not in place of them. The summary gives an overview, and the inline message gives the detail.

## Worked example: the email field on a sign-up form

This walk-through describes a sample sign-up form with an email field, built from design-system guidance. It is not a screenshot of any live product. A review of Google's Gmail sign-up form notes that each field has instructions underneath, which is why it is a useful reference. This lesson did not read Stripe's screens, so it does not describe them.

1. **Start with a visible label:** The label 'Email address' sits above the box and stays on screen while the user types.
2. **Add the placeholder as an example:** Inside the empty box, a faint name@example.com shows the shape of a correct answer. It is not the label.
3. **Place helper text under the field:** One short line reads: 'We will send a confirmation link to this address.' It explains why the field is needed before any mistake.
4. **Show the focus indicator:** When the user clicks in, a thick outline appears. The label stays put.
5. **Check when focus leaves:** The user types 'name@' and moves on. The check runs now and finds that the domain is missing.
6. **Show the inline error:** The helper text is replaced by 'Enter a valid email like name@example.com.' The border turns to the error look, and a small icon appears.
7. **Confirm the correct value:** When the address is correct, the field shows the success look with a small check mark, and the error goes away.

Each part has one job. The label names the field, the placeholder shows an example, the helper text explains the purpose, the focus indicator marks the active box, and the error gives a clear fix. Now turn this one example into a reusable component. Its parts are the label, field container, placeholder, helper text, error message, and success icon. Its states are default, hover, focus, filled, disabled, read-only, error, and success. Its rules say to check when focus leaves the field, to show one error per field, to replace helper text with the error, and to keep the label visible at every moment.

## Writing the component down so every team can use it

A good component is written down, with its parts, states, input types, validation rules, and examples of good and bad messages. Without it, each team will invent a new text field.

- **Anatomy:** The core parts, with the rule for when each one appears.
- **States:** Each state with one written visual rule.
- **Validation and wording:** When to check the value, where the message appears, and examples of good messages.

Test the document with a new team member. Ask them to fill in a form using only the document. If they cannot tell which field is which, the anatomy needs work.

## Check your understanding

Try these three short scenarios. Each one uses an idea from this lesson.

**Quick check:** A delivery form asks for a postcode. The designer puts 'Postcode' only in the placeholder. Once the user types, the word disappears, and the user cannot remember which box was the postcode. What is the best fix?

A. Make the placeholder bolder so it stays visible after typing starts.
B. Add a persistent visible label above each field and keep the placeholder only for an example.
C. Remove helper text so the form looks cleaner.
D. Show the label only after the user submits the form.

**Answer:** B. The label names the field, so it must stay visible at all times. A placeholder vanishes once typing begins, so it cannot be the only name. It can still show an example.

**Quick check:** A user types 'maria@' into an email field and is still typing. The component shows a red error under the box right away. What is the main problem, and what rule should apply?

A. The error is too small, so the text should be larger.
B. The check runs too early. It should wait until focus leaves the field or the user submits.
C. The field should use plain text so no check is needed.
D. The error should appear only at the top of the form.

**Answer:** B. A message about a bad value can appear while the person is still typing, which is distracting. The safer rule is to check when focus leaves the field, or on submit for long forms. Moving the error away from its field makes it harder to find.

**Quick check:** A password on a sign-up form is too short. The team has four possible messages. Which one should the component use?

A. An error occurred.
B. You entered an invalid password.
C. Use at least 8 characters for your password.
D. Error: password.

**Answer:** C. A good message is specific and says how to fix the problem. The other choices are vague, blame the user, or repeat the word error without adding help.

## Key takeaways

- **One part, one job:** The label names the field, the placeholder shows an example, the helper text explains the rule, and the error gives the fix.
- **Keep the label visible:** A placeholder is never a label. It disappears when typing starts.
- **Define every state:** Each state needs a written look, and focus must always be visible.
- **Choose the type and timing:** Pick the input type that fits the data, and check the value when focus leaves the field.
- **Write helpful errors:** Name the problem, show the fix, and place the message next to its field.

## Sources

- [Red Cross Design System: Text input](https://design.redcross.org.uk/components/text-input)
- [Lightning Design System: Input](https://www.lightningdesignsystem.com/2e1ef8501/p/8268ee-input)
- [Material Design 3: Text fields guidelines](https://m3.material.io/components/text-fields/guidelines)
- [Halstack Design System (DXC): Text input](https://developer.assure.dxc.com/halstack/next/components/text-input/)
- [Carbon Design System: Text input usage](https://carbondesignsystem.com/components/text-input/usage/)
- [Carbon Design System: Text input guidelines](https://www.carbondesignsystem.com/building-blocks/core/components/text-input/guidelines)
- [ServiceNow Horizon Design System: Input](https://horizon.servicenow.com/workspace/components/now-input)
- [Design Systems Collective: Input isn't a text field](https://www.designsystemscollective.com/input-isnt-a-text-field-text-field-isn-t-a-form-here-s-why-it-matters-efe82affdb13?gi=7f7872b0ec24)
- [Cieden: How to design an input field](https://cieden.com/book/atoms/input/how-to-design-input-field)
- [Pope Tech: Accessible form validation with examples](https://blog.pope.tech/2025/09/30/accessible-form-validation-with-examples-and-code/)
- [TetraLogical: Foundations of form validation and error messages](https://tetralogical.com/blog/2024/10/21/foundations-form-validation-and-error-messages/)
- [Evil Martians: HTML best practices for login and sign-up forms](https://evilmartians.com/chronicles/html-best-practices-for-login-and-signup-forms)
- [California Courts Design System: Forms](https://webservices.courts.ca.gov/design-system/component-library/forms)
- [Creator's Toolbox: Write form errors that help people recover](https://creatorstoolbox.com/blog/write-form-errors-that-help-people-recover)
- [72Technologies: Form field error patterns that help users](https://www.72technologies.com/blog/form-field-errors-inline-validation-patterns)
- [Wiser Notify: Signup form examples (review of Google's Gmail sign-up form)](https://wisernotify.com/blog/best-signup-form-examples/)
- [Captain Design: A guide to design text fields and forms](https://www.captain-design.com/blog/7-a-guide-to-design-text-fields-forms-for-your-design-system/)
- [Formcreator AI: Inline validation and error messages](https://www.formcreatorai.com/inline-validation-error-messages-accessible-real-time)
- [Set Product: Input field UI design, states, anatomy, and validation](https://www.setproduct.com/blog/input-ui-design)
- [Lollypop: Everything you need to know about text field design](https://lollypop.design/blog/2026/january/text-field-design/)
