Text Input

The Text Input component allows user to type in text.

DetailsProperties

Introduction

Evergreen exports two components to create text inputs:

  • TextInput: base text input component. Directly maps to a input element.
  • TextInputField: combines a label, text input and validation message in one. Used for traditional forms.

The TextInput component is a basic text input component. It directly maps to a input element.

Controlled usage

The TextInput component works the same as using input directly. Use e.target.value to get the value of the component on change.

Disabled

Invalid

TextInputField

The TextInputField component combines a TextInput with a label and optional description, validationMessage and hint.

Label and description

This is a description.

A hint is under the text input

This is a hint.

Required text input field

This is a description.

Invalid field

This is a description.

Validation message without invalid input

This is a description.

Controlled usage

The TextInputField component works the same as using input directly. Use e.target.value to get the value of the component on change.

This is a description.