Input
- A simple user input. We use this input to build all of the other input types. This is ideal for text, email, and password fields.
Placeholder
Labels
For accessibility, consider wrapping your <Input />
in a <Label />
.
Use slot="input"
to correctly render.
Error states
These inputs can have two error states. Both implement the Input component’s error state, which includes changing the input field’s border to the semantic/danger-dark color, accompanied by an error icon to the right.
Error message below input
The first error state displays a message directly below the input field, also styled in semantic/danger-dark color text.
Error message in reactive tooltip
The second shows a reactive tooltip with error messaging.
Error state guidelines
When to use each error state
The reactive tooltip variant should only be used in cases with vertical space constraints around the input.
In general, use error messaging below inputs when vertical space is available below the input. Otherwise, use tooltip. Tooltips should be used in situations with limited space and/or padding. In these situations, the input usually does not have a label. Error messages should be used if a value is missing.
Numeric Input
A user input for numeric values. This is ideal for number and integer fields. The value can be incremented/decremented using the up/down arrow keys.
Slider Input
A user input for numeric values that allows easy adjustments with a slider. This is ideal for number and integer fields you expect the user to tweak often, and the value can be incremented/decremented using the up/down arrow keys.
Range Input
A user input for numeric values within a specified range that allows easy adjustments with a slider. This is ideal for number and integer fields you expect the user to tweak often, should be restricted between a min and max value, and the value can be incremented/decremented using the up/down arrow keys. It also includes a numeric input for direct inputs.
Helper text
Helper text below an input field surfaces supplementary information about an input to aid users in filling out fields correctly. It can also be used to clarify how the information will be used.
Use helper text sparingly and intentionally. Excessive helper text can clutter the interface and overwhelm users, especially in complex forms with many fields. Use only when users likely need extra guidance to complete a field correctly.
If the input label already provides sufficient context for filling an input, do not include helper text. If the information is less critical and the user does not need to directly reference it while filling in the input, consider using an info icon by the label with a tooltip to maintain a clean interface while still providing necessary context.
Use helper text…
• To provide clarifying information required to know how to correctly fill out the input
• To show helpful hints about required format (ex: “Format: MM-DD-YYYY”) or examples of the correct format
Don’t use helper text…
• If the input label already provides sufficient context for completing the action