<XrTextField>
A single-line text input with a real caret: tap where to type. The physical keyboard types into it on a desktop, <XrKeyboard> or the headset's system keyboard (Meta Quest) in the headset. Enter emits submit. See Text and voice input.
Usage
vue
<XrTextField v-model="message" placeholder="Type here…" @submit="send" />
<XrTextField v-model="password" type="password" />API
Props
| Prop | Type | Default | Description |
|---|---|---|---|
type | "text" | "password" | 'text' | password shows dots instead of the text. |
ui | Record<string, unknown> | {} | Escape hatch: raw uikit (@pmndrs/uikit) properties, merged last. |
disabled | boolean | Greys it out; it cannot take focus. | |
parts | Partial<Record<"input", Record<string, unknown>>> | Raw uikit properties per inner part, merged after the defaults: input (the text, caret and placeholder). | |
modelValue | string | The text (v-model). Without it the field keeps its own text. | |
placeholder | string | Shown, muted, while the field is empty. |
Events
| Event | Payload | Description |
|---|---|---|
blur | It lost text focus. | |
focus | It took text focus. | |
submit | value: string | Enter was pressed, on any keyboard. |
update:modelValue | value: string | The text changed: typing, XrKeyboard, voice or the system keyboard (v-model). |