# Class TextInput

A text input widget with standard styling.

## Index

### Methods

- build
- getElement
- getInput
- getValue
- reset
- setValue

### Constructors

- constructor

## Methods

### build

- build(): HTMLElement

- - Defined in ui/FormWidgets/TextInput.ts :133

  Gets the element on which the text input is bound.

  #### Returns HTMLElement

  The text input element.

### getElement

- getElement(): HTMLElement

- - Defined in ui/FormWidgets/TextInput.ts :92

  Gets the element on which the text input is bound.

  #### Returns HTMLElement

  The text input element.

### getInput

- getInput(): HTMLInputElement

- - Defined in ui/FormWidgets/TextInput.ts :141

  Gets the `input` element (the text input itself).

  #### Returns HTMLInputElement

  The `input` element.

### getValue

- getValue(): string

- - Defined in ui/FormWidgets/TextInput.ts :100

  Gets the value currently entered in the text input.

  #### Returns string

  The text input current value.

### reset

- reset(): void

- - Defined in ui/FormWidgets/TextInput.ts :120

  Resets the text input.

  #### Returns void

### setValue

- setValue(value: string): void

- - Defined in ui/FormWidgets/TextInput.ts :108

  Sets the value in the text input.

  #### Parameters

  - ##### value: string

    The value to set the text input to.

  #### Returns void

## Constructors

### constructor

- new TextInput(onChange?: function, name?: string, options?: ITextInputOptions): TextInput

- - Defined in ui/FormWidgets/TextInput.ts :66

  Creates a new `TextInput`.

  #### Parameters

  - ##### Default value onChange: function = (textInput: TextInput) => {}

    The function to call when the value entered in the text input changes. This function takes the current `TextInput` instance as an argument.

    - - (textInput: TextInput): void

      - #### Parameters

        - ##### textInput: TextInput

        #### Returns void

  - ##### Optional name: string

    The text to display in the text input label or placeholder.

  - ##### Optional options: ITextInputOptions

  #### Returns TextInput

### Hierarchy

- TextInput

### Implements

- IFormWidget
- IFormWidgetSettable