
Description
Add text entry to a Meta Display Glasses webapp. Standard HTML inputs open the on-glasses composer (handwriting + voice) when focused and tapped. Use when the user wants a text field, search box, form input, or notes area.
SKILL.md
Required reading
Before generating or modifying any code, read both:
../../references/display-guidelines.md../../references/performance-guidelines.md
These define the non-negotiable display physics, input model, and performance budgets for Meta Display Glasses webapps. Do not skip — generated UI that ignores these will fail on-device.
If these reference files are unavailable in an isolated eval, do not search /, home directories, or unrelated workspaces. Apply the requirements already present in this skill and continue.
Add Text Input to Meta Display Glasses WebApp
Add text entry to a webapp using standard HTML form controls. On the glasses, a focusable text control opens the on-device composer (handwriting + voice) when the wearer focuses it and taps. Whatever they enter is committed back into the field. No SDK call is needed — you do not build the composer; the glasses provide it.
Prerequisites
- Existing webapp created via
/create-webapp
How It Works
Any standard focusable text control becomes voice + handwriting capable for free:
<input type="text">,type="search",type="email",type="url",type="tel",type="number"<textarea>contenteditableelements
The interaction is focus the field, then tap to open the composer. Text is committed back to your field and fires the standard input and change events — read the value there, not from keydown.
⚠️ Caveats (must-include)
- The composer opens on focus + tap, not on focus alone. A programmatic
.focus()will not surface it — the wearer must tap a focused field. inputmode,enterkeyhint, andtypedo not change the composer.typeonly controls eligibility.- Avoid
type=password(anddate,checkbox,radio, etc.) — the composer won't open for them. Never rely on the composer for a password field. - You cannot choose handwriting-only vs dictation-only from the page — the wearer picks in the composer.
- On some builds the composer may be unavailable. Keep fields usable and don't make required input depend on it without a fallback (e.g. D-pad selection).
- Read committed text from
input/changeevents — notkeydown(there is no hardware keyboard).
Steps
1. Add the Field with a Hint
Give every field a placeholder (or aria-label) — it's the hint the wearer sees for what the field is for:
<label for="note">Note</label>
<textarea id="note" class="focusable" placeholder="Tap to write or speak"></textarea>
For a search box:
<input id="q" type="search" class="focusable" placeholder="Tap to search">
2. Make It Focusable + Read the Value
Standard form controls are focusable by default; ensure they participate in your D-pad focus order. Read the value on input (fires as the composer commits) or change:
var note = document.getElementById('note');
note.addEventListener('input', function () {
console.log('value:', note.value); // composer commits fire 'input'
// e.g. persist via /add-local-storage, or run a search
});
3. Wire Search / Submit (optional)
var q = document.getElementById('q');
q.addEventListener('change', function () {
runSearch(q.value);
});
Verify
- Field is focusable and reachable via D-pad
- Focus-then-tap opens the on-glasses composer
- Committed text appears in the field
- An
input(orchange) handler readsfield.value— notkeydown - Every field has a
placeholderoraria-labelhint - No
type=password(or other non-text type) used for composer entry - App stays usable if the composer is unavailable on a build
Related Skills
/add-ui— Add forms, search bars, and other UI around the field
More skills from the meta-wearables-webapp repository
View all 12 skillsadd-device-sensors
integrate device sensor data
Sep 1FrontendHardwareIoTadd-gestures
handle gesture interactions in webapps
Sep 1DesignFrontendInteractionadd-local-storage
add client-side data persistence
Sep 1FrontendPersistenceStorageadd-offline
enable offline support for webapps
Sep 1FrontendOfflinePerformanceadd-ui
add UI components to webapps
Sep 1FrontendJavaScriptReactUI Componentsconnect-api
connect webapps to REST APIs and WebSockets
Sep 1API DevelopmentFrontendREST APIWebSockets
More from Meta Open Source
View publisherrelay-best-practices
write idiomatic Relay code
relay
Apr 22EngineeringFrontendGraphQLReact +1relay-performance
optimize Relay application performance
relay
Jun 10FrontendGraphQLPerformanceReact +1add-shape-types-to-torch-model
annotate PyTorch models with tensor shapes
pyrefly
Jul 18Data ModelingDeep LearningPythonPyTorchcamera-streaming
configure camera streaming and photo capture
meta-wearables-dat-ios
Aug 6CameraHardwareiOSVideodat-conventions
develop iOS applications with DAT SDK
meta-wearables-dat-ios
Aug 6iOSMobileSDKSwiftdebugging
debug wearable device software
meta-wearables-dat-ios
Aug 6DebuggingEngineeringiOS