Text field
Component preview
A labeled single-line control for entering or editing one textual value.
Build pack
Choose the task and destination. Technical names stay in English.
In your own words
Documented aliases: text input, input field, single-line input
Try it
Compare all three behaviors
Shared comparison scenario: A form collects text, with field length and submission intent determining the appropriate input control.
This context stays fixed. Switch concepts to observe the mission, edge case, and specimen specific to each behavior.
Text field
Text field accepts one line; Textarea accepts multiple lines, while Search field submits a query through a search context.
Your task
Enter a valid name, submit, then exceed the limit and recover from the linked validation message.
Edge case to verify
After invalid submission, the entered text remains, the precise error is linked, and focus moves only according to the form recovery plan.
Mission
Enter a valid name, submit, then exceed the limit and recover from the linked validation message.
Select a marker directly on the specimen, or use the list below, to see its role. Hide the markers to operate the lab without obstruction.
Label
The persistent text that names a control or field.
Enter text
Typing edits a single value while selection, clipboard, and undo behaviors remain native.
Explain validation
A specific inline message identifies the invalid field and explains how to correct it.
Display name valid
Display name valid
Display name invalid
Display name invalid
Display name valid → Display name invalid
Submitting a value above the stated length limit preserves the text and links the precise error.
Display name invalid → Display name valid
Editing the value back within the stated limit resolves the linked validation error.
label with input
Equivalence caveat: The visible label remains separate from placeholder text, and help or error messages are programmatically associated.
Verify binding sourceWHATWG · standard · 2026-07-16
Claim covered: Text field: native input types, labeling, state, validation, and form participation.
WHATWG · standard · 2026-07-16
Claim covered: Text field: native form controls, labels, submission, validation, and disabled-state behavior.
Verified on 2026-07-16 · rev. 1