Input is a single-line text field. It's one of the basic components for all kinds of forms, search fields, etc.
Other input types for entering certain data:
The input has two sizes.
|Size (height in px)||Appearance example|
We recommend adding a visible text label to the input wherever possible. If the input isn’t required, be sure to mark it with the "optional" text label.
|Size (height in px)||Text size||Appearance example||Margins|
|M (28px)||14px (use |
|L (40px)||16px (use |
Addon is a slot inside the input field – to the left and right of the text – for placing icons, badges, counters, etc. Addon can be non-clickable and clickable.
- When adding an icon before the text (leading addon), use a non-clickable icon. This icon is usually colored to match the text or a different color based on the purpose it serves.
- When adding an addon after the text (trailing addon), you have various options such as a clickable icon, a counter, a badge, a spinner, an icon button, or a link. The clickable icon should have the
--icon-secondary-neutralcolor. When hovering over it, the color changes to the darker one with CSS filter, and the cursor changes to
|Input size||Icon size||Addon's indents||Addon's minimum width|
When two addons are stacked together, their indents will be divided in half. This ensures that there is a sufficient clickable zone (touch target) around each addon.
read-only state for component that cannot be interacted with, except for copy its value. Also use it for links which might be copied.
disabled state if you need to show affect of one component to another.
For live examples of the input types, refer to Example tab.
The search input can have a non-clickable icon before the text and the icon for clearing the value after the text.
Input with a counter
You can place Counter inside the input or next to its label. Counter usually shows the number of available characters, limits, etc. The counter is usually non-clickable.
Please don’t use the Tag component for the counter. It has a different purpose and functionality.
|Size (height in px)||Counter next to the input's label||Counter inside the input|
Usage in UX/UI
- Use input fields only for single-line information. If you need to enter a lot of data, use a Textarea instead.
- Label the inputs clearly, so users can quickly understand what data needs to be entered.
- Select an appropriate width for the input field based on the content to be entered. For example, if it's for a phone number, the input width shouldn't be wider than what is expected for a phone number.