Input
input accepts a single line of text and displays an input cursor while focused.
Enter and Synchronize Text
<input value="{{query}}" placeholder="Search" maxLength="100" bindinput="handleInput" />
export default {
data: { query: '' },
handleInput(event) {
this.setData({ query: event.detail.value });
},
};
Properties
| Property | Type | Default | Description |
|---|---|---|---|
value | String | "" | Current text. |
placeholder | String | "" | Hint shown while the field is empty and unfocused. |
disabled | Boolean | false | Whether keyboard input is ignored. |
maxLength | Number | - | Maximum number of accepted characters. |
Placeholder color resolves from --input-placeholder-color, then --color-text-secondary, and finally the built-in gray fallback.
Events
| Event | Event Data | Description |
|---|---|---|
bindinput | { detail: { value: string } } | Fires whenever the text changes. |
event.detail.value is the full updated input text, not the character delta from the latest key. Use it directly for additions, deletions, and continuous input.