Search the design system

Components

Input

The input component facilitates entry and editing of text and numbers.

Image of input component

Usage

The input component is used to allow the user to input letters and numbers into a field. The input can be validated to ensure it conforms to the expected format. Depending on context accepted input can be restricted to for example only numbers when adding a telephone number. When incorporating an input field into a design, ensure users clearly understand the expected input by effectively using labels, placeholders, and help text.

Interaction states

Default

Input interaction default example

The default state, prior to user interaction.

Focus

Input interaction focus example

The input field is in focus and is available for accepting input.

Error

Input interaction error example

Validation has failed and an error message is displayed.

Disabled

Input interaction disabled example

The input field is not available for interaction. For accessibility considerations, avoid using the disabled state in your designs if possible.

Regular input and text area

For shorter input of text that comfortably fits on one line of text the regular input field is used, e.g. an email address or an amount of currency. For larger bodies of text, such as a written message, the Text area component can be used, which can be configured to be taller and support multiple lines of text.

Input field

Regular input example

A regular input field.

Text area

Text area example

A text area, designed for longer blocks of text.

Formatting

Anatomy

The input element features a label, input field, optional help text, error text, and icons.

Input anatomy example

A. Label text
B. Input text
C. Placeholder text
D. Help text
E. Error text
F. Container
G. Focus indicator
H. Error indicator
I. Icon leading
J. Action trailing
K. Suffix

Label text

Describes the expected input, e.g. “Email address”, “Deposit amount”. Keep the label text short, clear and concise, and pursue to make it no longer than a few words.

Placeholder text

The placeholder text can provide example or hints regarding the expected format value or syntax. Keep in mind that once user starts interacting with the input field, the placeholder text is replaced with the user input, as such it is important to make sure important information is available in the label or help text.

Input text

The input provided by the user.

Help text

The help text is an optional field that can be used to provide additional guidance or contextual information about the expected input. Consider using the help text when extra clarification is needed for the user to complete their task.

Error text

Error text is displayed when validation fails and is used to inform the user that the text or value is incorrect and ideally what needs to be corrected in order to achieve success.

Suffix

For certain types of input the suffix field can be enabled in order to provide additional context related to the entered value, such as “kr” when a currency amount is expected.

Icon leading

The Icon leading option can be used for visually further aiding the user in correctly filling the input field with the expected input.

Action trailing

Action trailing is an Icon button that can be used for actions within the input field. Typically it can be used for clearing an input field or revealing / hiding the entered value within an input field used for entering a password.

Modify

Outline variant

The input component is available as an outline variant, where the background of the container is omitted. When using, be aware of accessibility considerations for the input and placeholder text against the underlying background.

Input modify outline example

Input in solid and outline variants.

ComponentsFloating Action Bar / Code
ComponentsInput / Code

© DesignTech - AB Svenska Spel

What's newTerms of useAccessibility statementCookiesTeams channel [Internal]
@svs/ui version
2.3.0

Feedback

We always want to improve the Design System and would be thrilled to get your feedback.

Please share your wisdom with us.

Microsoft Teams [internal]

Designsystem@svenskaspel.se