Skip to content

<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 ​

PropTypeDefaultDescription
type"text" | "password"'text'password shows dots instead of the text.
uiRecord<string, unknown>{}Escape hatch: raw uikit (@pmndrs/uikit) properties, merged last.
disabledbooleanGreys it out; it cannot take focus.
partsPartial<Record<"input", Record<string, unknown>>>Raw uikit properties per inner part, merged after the defaults: input (the text, caret and placeholder).
modelValuestringThe text (v-model). Without it the field keeps its own text.
placeholderstringShown, muted, while the field is empty.

Events ​

EventPayloadDescription
blurIt lost text focus.
focusIt took text focus.
submitvalue: stringEnter was pressed, on any keyboard.
update:modelValuevalue: stringThe text changed: typing, XrKeyboard, voice or the system keyboard (v-model).

MIT License