XR developer preview
develop specs/develop/xr-preview.kmd
Forward-looking spec for Koder Design on XR surfaces (Vision Pro, Quest, Android XR). Material parity (`/develop/extended-reality`). Defines the **preview** stage: scope, target platforms, layout primitives, input model, accessibility — not yet a shipping product surface. Status: `preview`.
Quando esta spec se aplica
Triggers primários
- Add XR developer preview
Todos os triggers
- Plan Koder Design for Vision Pro / Quest / XR2
- Document spatial layout primitives
- Reserve XR namespace in develop catalog
Corpo da especificação
Spec — XR developer preview
Facet Develop of Koder Design. Material parity: https://m3.material.io/develop/extended-reality.
Status: preview (not yet shipping; evolves with platforms).
URL: https://kds.koder.dev/{locale}/develop/xr/.
Scope of "preview"
This spec reserves the surface and contract for XR adaptations without committing to ship in v1. It's a forward declaration so:
- Token taxonomy already considers XR before stabilizing
- Component specs avoid 2D-only assumptions that break XR adaptation
- Implementer can experiment knowing the contract will be respected
R1 — Target platforms
| Platform | API | Status |
|---|---|---|
| Apple Vision Pro | visionOS SwiftUI + RealityKit | Tier 1 (primary) |
| Meta Quest 2/3/Pro | Android XR via Quest OS | Tier 2 |
| Android XR | Generic Android XR API (Pixel XR, etc.) | Tier 2 |
| Browser-based WebXR | WebXR API (Chrome, Firefox) | Tier 3 (experimental) |
Tier 1: full spec coverage at v1. Tier 2: feature-parity within 6 months of v1. Tier 3: opt-in, may diverge.
R2 — Layout primitives
| Primitive | 2D equivalent | XR adaptation |
|---|---|---|
| Volume | Page / window | Bounded 3D space (cube), depth respected |
| Panel | Card / surface | Flat 2D surface anchored at world position |
| Floating window | Modal dialog | World-anchored 2D panel, follows user gaze direction loosely |
| Hand reach | Touch | Direct interaction (pinch / grab) within ~50 cm |
| Eye + pinch | Mouse hover + click | Eye gaze for hover, pinch fingers for click (Vision Pro pattern) |
R3 — Visual tokens — XR additions
XR adds tokens NOT present in 2D specs:
| Token | Purpose |
|---|---|
--kds-xr-glass-blur | Backdrop blur for floating panels |
--kds-xr-glass-opacity | Panel translucency vs scene behind |
--kds-xr-shadow-distance | Cast shadow distance in centimeters |
--kds-xr-typography-scale | Multiplier for typography (XR is "viewed from arm's length") |
Per themes/elevation.kmd § R5, elevation in XR becomes a literal
z-axis offset; tokens map 1 dp ≈ 0.5 cm in XR space.
R4 — Component adaptations
Each canonical component must define its XR rendering OR explicitly mark as not-yet-supported:
| Component | XR adaptation |
|---|---|
| Button | Floating affordance with hover-lift on eye gaze; pinch to activate |
| Card | 2D panel anchored in world; clickable region same as 2D |
| Dialog | Floating window centered at user's eye line at ~1 m distance |
| Snackbar | Floats below user's gaze, ~50 cm; follows gentle eye motion |
| Tabs | Horizontal row at top of volume; row can be re-anchored to side via context menu |
| Navigation drawer | Slides from left edge of volume; pinch-and-drag to open |
Components NOT yet adapted (Tier 1 missing): carousels (XR equivalent unclear — defer), sliders (need hand-grip implementation), pickers (volumetric date picker — research project).
R5 — Input model
| Input | Mapped action |
|---|---|
| Eye gaze + pinch (Vision Pro) | Hover + click |
| Hand reach + pinch | Direct manipulation (drag, scroll) |
| Voice command | "Open menu", "Submit form" (per voice/wake-word.kmd) |
| Bluetooth keyboard | Same as 2D keyboard semantics |
| Gamepad / controller | Mapped to D-pad + buttons (Tier 2 / Quest) |
Tier 1 (Vision Pro) requires eye + pinch + voice. Tier 2 (Quest) adds controller fallback.
R6 — Accessibility in XR
- VoiceOver / TalkBack analogues work in XR (audio-described navigation)
- Hand-reach interactions have fallback via gaze + pinch for users with limited mobility
- Reduce Motion in XR = fewer floating animations + reduced positional reanchoring
- Color contrast applies in XR (background = scene, not just surface — UI contrast checker accounts for scene brightness)
R7 — Performance budgets
| Budget | Target |
|---|---|
| First panel paint | < 100 ms (anchored panel) |
| 60 fps interaction | Mandatory (less = nausea) |
| 90 fps preferred | Vision Pro target |
| Cold start | < 2 s from launch to first interaction |
XR is unforgiving of dropped frames — under-budget hardware should gracefully reduce visual complexity (lower elevation, simpler shadows) not the frame rate.
R8 — Forbidden patterns
- ❌ 2D modal that completely blocks XR scene (immersive mode handles modals via floating windows; full-screen takeover breaks immersion)
- ❌ Animations that move > 30°/s in user's gaze area (motion sickness)
- ❌ Pinned UI in the center of view (forces user to look away)
- ❌ Tiny hit targets (< 4 cm in world space)
- ❌ Sound effects with no spatial audio anchor in XR contexts
- ❌ XR-specific tokens that don't degrade gracefully in 2D (must define 2D fallback per token)
R9 — Versioning
XR preview tracks its own minor version inside Koder Design semver:
koder-design v1.5.0may includexr-preview v0.3(still preview)- XR exits preview when at least 1 Tier 1 platform ships a real Koder app and the contract is owner-ratified
R10 — Status badge
The catalog page MUST show:
┌─────────────────────────────────────────────┐
│ 🚧 PREVIEW │
│ This spec is forward-looking. Components, │
│ tokens, and interactions may change before │
│ the first stable release of Koder Design │
│ XR. Experiment freely; do not depend on │
│ the API as stable yet. │
└─────────────────────────────────────────────┘
Cross-link
themes/elevation.kmd— z-axis mappingapp-layout/safe-area.kmd— analogous to XR volume boundariesvoice/wake-word.kmd— voice as primary XR inputcomponents/*.kmd— per-component XR adaptation notes
Implementation tracking
engines/sdk/koder-design-xr/— placeholder (preview status)- Linked Material doc: https://m3.material.io/develop/extended-reality
- Owner-curated; not auto-generated. Updated per Tier 1 platform release.
Referências
specs/themes/color-roles.kmdspecs/themes/elevation.kmdspecs/app-layout/safe-area.kmdspecs/app-layout/window-size-classes.kmdspecs/components/navigation.kmd