Vue playground

Nova v3.37.0

Preview

Vue

Text field

nv-fieldtext

Captures single-line user input, typically used in forms or filters.

Live demo

Size

Use a text field for short, single-line input such as a name, an email address or a search term.

Anatomy

A text field with three callouts: 1 marks the label Field label, 2 the input showing the placeholder Input example, and 3 the description below it.

The parts of a text field.
  1. Label (optional) says what to enter.
  2. Input holds the text. It fills its container up to 480 px; set fluid for wider layouts. An icon or unit can sit inside it, before or after the text.
  3. Description (optional) adds guidance below the input.

States and feedback

Hover and focus styles are built in. A disabled field cannot be used; a read-only field shows its value without allowing edits. required adds an asterisk to the label and marks the native input as required.

default
disabled
readonly

When the input is invalid, set error with an errorDescription that says how to fix it: the field shows a red border, an error icon and the message. Once the input is valid, success shows a green border and a check icon.

error
success

Themes

The design includes Spark and Ocean appearances. Use the page's theme and mode controls to compare the live examples; retain the same labels, states and validation messages in each theme.

Guidelines

  • Give every field a clear label that names its purpose.
  • Keep placeholder text brief. It disappears as people type, so it cannot replace the label or instructions.
DoLabel the field and keep the placeholder to a short example.
Don'tAvoid using the placeholder as the label or for instructions.

Sources