Skip to content

The TextField Component

Use the TextField component to input text.

Different from the Textarea component, the TextField component is a single-line input.

TriggerComponent

Example

ts
if (_.xTextField(value, "Username", disabled)) {
  console.log(`New value: ${_.$ev}`);
}

Param: value

type: Model<string>

The value of the text field.

Param: label

optional

type: string

Content if HTML label is supported.

The label of the text field.

Param: placeholder

optional

type: string

The placeholder of the text field.

May be combined with label.

Param: disabled

optional
= false

type: boolean

Whether the text field is disabled.

Triggered when: input

data type: string

When the value of the text field is changed, the new value will be emitted.