=== Background goal
The current Codex library [[https://www.figma.com/file/KoDuJMadWBXtsOtzGS4134/%E2%9D%96-Codex-components?node-id=2547%3A28279|Figma spec sheet]] for the TextInput component specifies an error state (with sub-states for when the input is filled or focused while in the error state), but this isn't currently implemented.
We should consider how to implement this in TextInput, and how the responsibility for error state management and styling should be divided between TextInput (and other inputs), and the Field component specified in T309239.
==== User stories
- As a user I need to know when a Text Input has an error and how to solve it.
==== Previous implementations
- **Codex demo:** https://doc.wikimedia.org/codex/main/components/demos/text-input.html
- **Design style guide:** https://design.wikimedia.org/style-guide/components/text-inputs-and-textarea.html
- **OOUI:** previous text input in OOUI [[ https://doc.wikimedia.org/oojs-ui/master/demos/?page=widgets&theme=wikimediaui&direction=ltr&platform=desktop#:~:text=MultilineTextInput%2C%20SearchInput%2C%20NumberInput-,TextInputWidget,-TextInputWidget%20(icon) | here ]]
==== Design spec
// Once a component spec sheet has been created in Figma, remove the note stating that the spec is missing and link to the spec below. //
| Component spec sheet |
==== Open questions
- For a good user experience each error state should provide the user with the solution to solve the problem. In this case, the text input error state should have an error helper text with the solution to fix the error. Do we want to include the error helper text as part of Text Input?
==== Acceptance criteria
**Design**
[] Update Figma spec sheet (if needed) and add link in this task
[] Update [[ https://www.figma.com/file/KoDuJMadWBXtsOtzGS4134/%E2%9D%96-Codex-components?node-id=2547%3A28279&viewport=-1292%2C-1298%2C0.32 | Figma library ]] component (if needed)
**Code**
[] Implement error text link in Codex