Menu
Components
This page is In Progress and subject to frequent changes
Please contact Gemma D. to verify any information is correct before using it.
Dropdown
In Progress
Hey, this is an old version. View the latest
Text in here.
UX Owner: Benjamin Puckering
UI Owner: Janey Long
Note: This component doesn't yet exist in Storybook, preliminary image(s) shown.
On this page
Example
[img id=XXX]
When to use
Text inputs can be used where:
- you’re asking a user for free form text data; and
- that data isn’t predictable; and
- that data isn’t expected to run onto a second line.
When not to use
Text inputs shouldn’t be used where:
- You’re asking for numeric values (try using a numeric input instead)
- The text string is likely to run to more than the length of the text input (consider using a text area instead)
If the information requested from the user can be (or is likely to be) broken into multiple parts, consider breaking the question into separate text inputs with one part of the answer in each.
Anatomy
Text input layout
Text inputs usually span 100% of the width available. However, the width can also be set to a specific value where it helps us indicate that we’re only looking for a short answer from the user.
Input states
Empty
The empty state is used where no text has yet been entered into the input (either by the user or through any form of pre-fill).
Using placeholder text
Use placeholder text only where it supports users in providing a valid input. Generally, this should be in the form of an example input.
Complete
The complete state is used wherever the field is not empty i.e. text has been entered into the input (either by the user or through any form of pre-fill).
The user input text is bolder and darker than the placeholder text used for the empty state, but the other style properties remain unchanged.
Interaction states
For general information and guidance about these states, see interaction states.
Hover
There is no hover style for text inputs. The cursor changes to the text select, which provides sufficient indication that the input is interactive.
Focus
When focus is applied to a text input an offset border is applied and the caret (text indicator) is displayed.
Disabled
When disabled, there are no hover or focus interactions and the text input can’t be interacted with. Both empty and complete inputs can be disabled. In both cases, the style is change to give the appearance of a 50% opacity.
Validation states
Error
Where text inputs are invalid, they use the same error state, irrespective of whether the validation is triggered due to an empty field or the field containing an invalid data format.
The border element is the only part of the field to change – the text style does not change.
As soon as a text input with the error validation state is focussed, the error state is removed.
Similar components
There are a range of components that either resemble (or are based on) the text input component.
Where to find this component
Documentation version history
Last updated Wednesday, 30th June 2021 13:22 by Gemma D.
Changes In This Version
| Changed Field(s) |
|---|
| Description |
| Content |
| Sketch Cloud Link |
| Zeplin Web Link |
Change History
| Change | Date | User |
|---|---|---|
| Version 34 | Wednesday, 30th June 2021 13:22 | Gemma D. |
| Version 33 | Wednesday, 30th June 2021 13:21 | Gemma D. |
| Version 32 | Tuesday, 29th June 2021 22:09 | Gemma D. |
| Version 31 | Monday, 21st June 2021 10:12 | Gemma D. |
| Version 30 | Monday, 21st June 2021 10:10 | Gemma D. |
| Version 29 | Monday, 29th March 2021 21:38 | Gemma D. |
| Version 28 | Monday, 29th March 2021 21:38 | Gemma D. |
| Version 27 | Monday, 29th March 2021 21:02 | Gemma D. |
| Version 26 | Monday, 29th March 2021 21:02 | Gemma D. |
| Version 25 | Monday, 29th March 2021 13:01 | Gemma D. |
| Version 24 | Monday, 29th March 2021 11:45 | Gemma D. |
| Version 23 | Friday, 26th March 2021 14:10 | Adrian T. |
| Version 22 | Friday, 26th March 2021 00:06 | Ken Pickering |
| Version 21 | Thursday, 25th March 2021 23:43 | Ken Pickering |
| Version 20 | Thursday, 25th March 2021 23:43 | Ken Pickering |
| Version 19 | Thursday, 25th March 2021 23:41 | Ken Pickering |
| Version 18 | Thursday, 25th March 2021 23:31 | Ken Pickering |
| Version 17 | Thursday, 25th March 2021 23:27 | Ken Pickering |
| Version 16 | Thursday, 25th March 2021 23:26 | Ken Pickering |
| Version 15 | Thursday, 25th March 2021 23:25 | Ken Pickering |
| Version 14 | Thursday, 25th March 2021 23:23 | Ken Pickering |
| Version 13 | Thursday, 25th March 2021 23:21 | Ken Pickering |
| Version 12 | Thursday, 25th March 2021 23:20 | Ken Pickering |
| Version 11 | Thursday, 25th March 2021 23:08 | Ken Pickering |
| Version 10 | Thursday, 25th March 2021 23:08 | Ken Pickering |
| Version 9 | Thursday, 25th March 2021 23:07 | Ken Pickering |
| Version 8 | Thursday, 25th March 2021 23:07 | Ken Pickering |
| Version 7 | Thursday, 25th March 2021 23:06 | Ken Pickering |
| Version 6 | Thursday, 25th March 2021 23:04 | Ken Pickering |
| Version 5 | Thursday, 25th March 2021 23:03 | Ken Pickering |
| Version 4 | Thursday, 25th March 2021 22:38 | Ken Pickering |
| Version 3 | Monday, 15th March 2021 22:32 | Gemma D. |
| Version 2 | Thursday, 11th March 2021 11:09 | Gemma D. |
| Version 1 | Tuesday, 2nd February 2021 17:40 | Gemma D. |