A fallback keeps a useful path available when a preferred browser feature, component contribution, or server resource is unavailable. Start with the behavior users need, then add the preferred experience where it works. A fallback need not reproduce every feature; it must preserve the part your application relies on. section 3.8.2 section 10.4.2
Choose the fallback at the boundary where something may be missing:
- Browser capability: check for an API before using it. Offer another usable behavior when support, permissions, or required user gestures are absent. Check compatibility data rather than assuming that a newly available feature works for every visitor. section 3.8.2 section 2.2.1
- Component content: put a meaningful default inside a slot. It appears only when no matching content is supplied; supplied content replaces it. Use slots for optional customization, not information required for the component to function. section 8.4.1 section 8.8
- Routing implementation: use URLPattern when available and a smaller matcher otherwise. If the alternative supports only literal path segments and named parameters, keep route definitions within that shared syntax. section 10.4.2
- Navigation: use the Navigation API where available. With the History API fallback, change the URL and render from the new location yourself; pushState() does not trigger popstate. section 11.2
- Deployment: serve real files first, then return index.html for application paths with no file extension. Rewriting every request can turn a missing JavaScript file into an HTML response and a misleading MIME type error. section 15.10
A default action in a component
An optional action slot can contain a disabled “Out of stock” button. If a consumer supplies an “Add to Cart” button for that slot, the default disappears. The component remains understandable without a supplied action, while the consumer controls the enhanced case. section 8.4.2 section 8.4.1
Fallbacks can form a progression rather than a single substitute. For a 3D product view, use the native model element where available, a model-viewer component elsewhere, and an AR Quick Look link as a minimal iOS or iPadOS option. Keep each path tied to an actual requirement, and test the less capable path as deliberately as the preferred one. section 3.6.3 section 3.9























