IntelliJ Platform Plugin SDK Help

Input Field

An input field allows users to enter or edit a text line using the keyboard.

Input

When to use

Use an input field if it’s not possible to enumerate the most likely values. Otherwise, use a combo box or a drop-down list.

Correct

Incorrect

Input when to correct
Input when to incorrect

When not to use

Previous input is saved

If the previous user input must be preserved, use a combo box.

Combobox when to use 1

Large input

Use a text area for long or multi-line input.

Input text area

Space is limited

If the place is constrained, use an expandable input field ExpandableTextField. For more details, see Expand button.

Input text input expand

Many predefined values

If there are many predefined values (for example, code snippets, commit author), add completion to the input field TextFieldWithCompletion. Show the completion popup when the user starts typing.

Input completion

Built-in buttons

Use built-in buttons to help the user enter data. For example, to browse the disk.

Use a search field to input a search query.

Input search

Password

If input data is secured, replace it with dots via JBPasswordField.

Input password

Choosing a color

Use a color box to choose a color.

Input colour box

How to use

Label

A label accompanies each input field and indicates the information type.

General rules

Correct

Input label 1 correct

Incorrect

Input label 1 incorrect

Label as a phrase

When writing a label as a phrase, don't use colon and ending punctuation.

Correct

Input label 2 correct

Incorrect

Input label 2 incorrect

Grouped input fields

If there are several input fields in a form, make labels approximately the same length to avoid gaps between labels and fields.

Correct

Input label 3 correct

Incorrect

Input label 3 incorrect

Disabled state

If an input field is disabled, disable the label too.

Input disabled

Selectable label

Make the label text selectable. The user may want to search for this option on the Internet or to send a question to support.

Input label selected

Positioning a label

Place the label on the left or above the input field. For more details, see the Layout topic.

Correct

Input positioning label 1

Correct

Input positioning label 2

Placeholder

Placeholder is gray text placed inside an input field. To show placeholder text, use JBTextField.getEmptyText().setText(...).

General rules

  • Use sentence-style capitalization.

  • Don't use ending punctuation or ellipsis.

  • Hide the placeholder when the user starts typing, not when the input field gets the focus.

Optional input field

Use the placeholder to indicate that an input field is optional.

Input placeholder optional

Default values

Use the placeholder to show the default value.

Input placeholder default

If the user overwrites the value, it can be restored by removing the new value from the input field or by clicking the Reset to default link on the right.

Input placeholder default reset

Showing examples

Don't use the placeholder to show examples because the user can get the impression that the field is already filled. Provide examples or explanation under the input field (see Context help):

Correct

Input placeholder example correct

Incorrect

Input placeholder example incorrect

Don't use placeholders as labels

Don't use the placeholder as the field label. After the field has been filled, it is difficult to understand its purpose.

Correct

Input placeholder label correct

Incorrect

Input placeholder label incorrect

Prefilled value

Pre-fill the field if it has the default or a frequently used value. Use the default text color for pre-filled values:

Input prefilled

Don't use Unnamed as a prefilled value. It takes time to read it and does not help the user to fill the form.

Correct

Input prefilled unnamed correct

Incorrect

Input prefilled unnamed incorrect

Field focus

When an input field gets the focus, place the caret at the end of the text:

Input focus

If users are more likely to re-enter the entire value, select the whole text when the field gets the focus:

Input focus selection

Validation

If the user enters an invalid value, highlight the field with red and show an error message in a tooltip. For more details, see Validation errors.

Input validation

Sizes and placement

Width

Choose the width appropriate for the most common values, but not less than 65px. The field width helps the user understand what value is expected and to make sure that they fill the field correctly.

Correct

Input width 1 correct

Incorrect

Input width 1 incorrect

If the input value is longer than the field width, show the beginning of the value when the field becomes inactive.

Input width 2

How to layout

Follow the labeled input controls.

21 July 2025