For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /guide/coming-from-web.md.

Coming from web Angular

This page lists everything that changes when you move Angular code from the browser to Lynx. Skim the cheat sheet first, then check the compatibility table for the features you use.

Cheat sheet

On the webOn Lynx
<div><view>. A <div> renders as one
<span>, <p>, <h1><text>. They render as one, and inherit text styles
<img src><image src>, which needs a width and height. An <img> renders as one, sized to fit
A scrolling <div><scroll-view>, or <list> for long lists
<button (click)><view (click)> with a <text> inside. A <button> renders as a <text> that taps
<input (input)><input (bindinput)>, with the value in $event.detail.value. (input) works too
(click)(click), which runs on a tap. Lynx's own name for it is (bindtap)
$event.stopPropagation()Works for a tap and touch events, as does Lynx's (catchtap): the tap goes no further up. On iOS and Android a pointer listener's stops only that element's pointer event
:root { --x: … }page { --x: … }
display: blockdisplay: linear, the default. display: block becomes it
:hoverNo equivalent. Use signals
bootstrapApplication from @angular/platform-browserbootstrapApplication from @blotch/angular-lynx
Zone.js or zonelessZoneless only
<a routerLink>routerLink on any element, <a> included
document, windowNot available
aria-label, role="button"Read by VoiceOver and TalkBack. ARIA with no Lynx equivalent does nothing

Your web templates render

AngularLynx renders common HTML tags as the Lynx element they stand for, so a template written for the browser shows up on a phone:

  • Block tags render as a <view>: <div>, <section>, <ul>, <li> and the like.
  • Text tags render as a <text>: <span>, <p>, <h1>, <a>, <button>, <label> and the like.
  • <img> renders as an <image> that takes its picture's size until CSS gives it one.
  • Text flows and inherits. Text and inline tags beside each other share a line, and take their ancestors' text styles.
  • DOM events that Lynx also sends run, such as (click), (input) and (keyup.enter).

It gets ported code on screen, but it isn't a browser. HTML tags lists what carries over and what doesn't. Write Lynx elements in new code: they have every attribute, and typed events.

Here's one component in each:

<!-- Web -->
<div class="card" (click)="select()">
  <img [src]="avatar" />
  <span>{{ name() }}</span>
</div>

<!-- Lynx -->
<view class="card" (click)="select()">
  <image [src]="avatar" class="w-10 h-10" />
  <text>{{ name() }}</text>
</view>

Templates

Lynx elements replace HTML. A Lynx app has no HTML engine. Lynx elements map to native UI controls instead, and AngularLynx renders common HTML tags as the closest one. Elements and layout lists them all.

Text belongs in <text>. On the web, text can sit anywhere. On Lynx, only a <text> draws it. Text written straight in a <view> or <div> still shows: AngularLynx draws it, and the inline tags beside it, in a <text>, which takes the text styles its ancestors' classes set. A <text> you write yourself inherits only its font size, so set its other styles on it, and nest <text> elements to style part of a sentence.

Import LYNX_ELEMENTS. Add it to every component that uses Lynx elements, as ng generate component does. It gives you type checking in your editor and makes ng test compile.

import { Component } from '@angular/core';
import { LYNX_ELEMENTS } from '@blotch/angular-lynx';

@Component({
  selector: 'app-hello',
  imports: [LYNX_ELEMENTS],
  template: `<view><text>Hello</text></view>`,
})
export class Hello {}

Events

DOM event names work where Lynx sends the same event. (click) runs on a tap and bubbles up to parent elements, as on the web, and $event.stopPropagation() stops it. (input) runs when the text changes, and (keyup.enter) when the keyboard's return key is pressed. A text field's value is in $event.target.value, as on the web. Pointer events, and the mouse events that say a pointer is over an element, such as (mouseenter), come from touches. Names Lynx has no event for, such as (keydown), never run.

Lynx's own event names start with bind or catch, and cover the events the DOM has no name for, such as (bindlongpress) and (bindscroll):

  • (bindtap) handles a tap and lets it bubble up, as (click) does.
  • (catchtap) handles a tap and stops it there, with no code.

Lynx's own data is in $event.detail. A text input's value, for example, is $event.detail.value.

A handler can do anything it would on the web, such as navigate or open an overlay.

See Handling taps and events for every event.

Styling

Lynx has its own CSS engine. It supports most layout CSS, but its defaults differ from a browser's:

  • Elements stack vertically by default (display: linear). Add display: flex (Tailwind's flex) for flexbox.
  • box-sizing is border-box, and margins don't collapse.
  • Only font-size is inherited. A font-size on a <view> reaches the <text> inside it, but a color there doesn't color it.
  • rem is 14px, not 16px. The UI components' theme makes it 16px.
  • Some features are missing: :hover, ::before and !important. @media works, against the page's size.

CSS on Lynx covers every difference. Tailwind CSS 4 works as on the web: the build adapts its CSS for Lynx.

The JavaScript environment

Your code doesn't run in a browser. There's no DOM, so document.querySelector and localStorage don't exist, and document.createElement makes only canvases and images that aren't shown. AngularLynx fills in what Angular itself needs, such as setTimeout and URL, and document: and window: listeners hear touches anywhere on screen.

To share stores and services with a web app, keep them in a library that TypeScript checks against what Lynx has: see Share code with an Angular web app.

Libraries that touch the DOM, or depend on browser APIs, won't work. That includes Angular Material and most of the CDK. Libraries that draw on a <canvas> work: chart and image libraries with its 2D context, and 3D libraries that draw with WebGL2, such as three.js and angular-three. The JavaScript environment lists what's available.

Angular feature compatibility

✅ works as on the web · ⚠️ works with differences · ❌ not supported

FeatureStatusNotes
Standalone components, DI, inject(), @Service()✅
Signals: signal, computed, effect, linkedSignal, resource, debounced✅Signals
input(), output(), model(), queries✅
@if, @for, @switch, @let, and Angular 22's ++, --, @default never and comments in a start tag✅
Pipes✅
Libraries that use Intl⚠️Add Intl with the intl build option
Content projection (<ng-content>)✅Content projection
ViewContainerRef.createComponent(), createComponent()✅With a hostElement, the component renders into that element
Change detection⚠️Zoneless only. Use signals, toSignal() or the async pipe
HTML tags⚠️Render as a <view>, <text> or <image>, with the browser's styles for inline text tags (<b>, <code>, <a href>…) but no others. HTML tags
Event bindings⚠️bind*/catch* names, and DOM names Lynx also sends. Events
Component styles✅Scoped as on the web. ShadowDom falls back to None, and stylesheets must be plain CSS. CSS on Lynx
Router⚠️No URL bar. routerLink works on any element. Routing
Lazy routes, @defer and injectAsync()⚠️Code isn't split into separate files, so injectAsync() finds its service already in the bundle. Every @defer trigger works, and on viewport takes rootMargin and scrollMargin, but on a device on idle doesn't wait for idle time, so on idle(500ms)'s timeout changes nothing. @defer
Signal, reactive and template-driven forms⚠️On <input>, <textarea> and the UI components' controls. No native checkbox, radio or select. Forms
@boundary error boundaries (Angular 22.2)✅Handling errors
Route error boundaries, withErrorBoundaries() (Angular 22.3)⚠️In <router-outlet>, <lynx-stack-outlet> and <lynx-tab-outlet>. A tab built ahead that throws in its first check is left out, and its error goes to the ErrorHandler. Show an error screen for a route
Router resources, withRouterResources() (Angular 22.2)✅In all three outlets, bound to inputs with withComponentInputBinding()
withViewTransitions()❌Lynx has no View Transitions API. <lynx-stack-outlet> slides screens in instead. Routing
i18n attributes and $localize⚠️Translations load at runtime, not at build time. Internationalization
animate.enter and animate.leave⚠️A class's timing must be in a plain rule the build can read. Enter and leave transitions
@angular/animations❌Use animate.enter and animate.leave, CSS transitions or LynxTransition. Animations
HttpClient, httpResource, fetch⚠️Absolute URLs only, and no FormData or stream bodies. Lynx's HTTP service can't cancel a download on unsubscribe, and may leave a streamed request pending. More
WebSocket⚠️Only in the apps ng build --platform makes, not Lynx Explorer. close() without a code sends 1000, not a frame without one. On iOS it doesn't store the handshake's cookies, go through the system's proxy or come under App Transport Security. More
Zone.js❌Lynx doesn't have the APIs it patches, so an app that loads it fails at startup. Zoneless only
NgZone✅As in any zoneless app, Angular injects a zone that does nothing: run() and runOutsideAngular() call the function, and onStable never emits
provideCssVarNamespacing() (Angular 22.1)❌Angular prefixes CSS variables with the app's namespace. Lynx compiles CSS ahead of time, so they keep their own names. CSS variables keep their names
WebMCP tools, provideExperimentalWebMcpTools() (Angular 22)❌In a browser with navigator.modelContext, Angular registers the tools for an AI agent to call. iOS and Android have none, so the call registers nothing and throws nothing: the app needs no change
ARIA attributes⚠️aria-label, aria-labelledby, aria-hidden, aria-modal, the values and states (aria-checked, aria-expanded, aria-valuenow…, as words) and the common roles. Not aria-live or aria-describedby. Accessibility
Angular Material, CDK overlays❌They render HTML. Use the UI components
TestBed.createComponent(), TestBed.createDirective()⚠️Render on the DOM in ng test. The testing library's render() and renderDirective() render on Lynx. Testing
ng generate, ng test, ng build, ng update✅Schematics