Input elements of type text create basic, single-line inputs, elements of type select are used to create a drop-down list.
Element is considered as BT-related one, therefore it can be seen across the whole application.
Text inputs can also be seen in many places, such as the:
The best place to see a select input is on the product page configurable options.
How to style text?
<aside> ➡️ Avoid complex password and telephone fields. They take a long time to implement and may significantly prolong the base template development time.
</aside>
<aside> ➡️ On mobile, the minimum font size of this element must be 16px. Otherwise, on focus, iPhone will zoom in to the element.
</aside>
The text input should be displayed in the following states:
When the element is required
Disabled state
Before it was filled in
While focused, with the cursor
With error displayed on the input
After it was filled in
<aside> ℹ️ Usually, styling this element takes from-to: 3-5h
</aside>
An example display of an input element
How to style select inputs?
<aside> ➡️ Note, that on desktop – select has a custom appearance, on mobile – native.
</aside>
The select input should be displayed in the following states:
An example display of the select element
<aside> ➡️ Inputs represented on Base Template should be the same as for molecules (address form) and the rest of the designs if inputs should inherit default styles.
</aside>
Issues with the designs
In ScandiPWA, text input styles are defined in 2 places:
style/base/_input.scss
defines the base styles for input
elementsField
component contains additional stylesTo override this component run the next command:
scandipwa override component Field
ScandiPWA had a lot of changes for Field logic and architecture across different versions, the next examples will be related to 5.1.1. since we have implementation examples for this version, 5.2.x. has different examples and new input types implemented as React components.