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 /examples/furniture-shop.md.

Furniture shop: the Lynx tutorial app

The two apps the official Lynx tutorials build, Product Gallery and Product Detail, as one Angular app. Tap a picture in the gallery to open its product page, swipe through the photos, and drag the page to the right to go back to the gallery.

The pictures, colors and copy are the tutorials'. Set it next to the ReactLynx original to compare the two.

What it shows

  • A waterfall <list> — list-type="waterfall" lays the pictures into two columns, and estimated-main-axis-size-px tells the list each picture's height before it loads. See <list>.
  • An element method — autoScroll scrolls the gallery by itself. The page calls it with invoke() once the list has rendered. See Call element methods.
  • A main-thread scroll handler — [mainThreadBindscroll] moves the glowing scrollbar on every scroll event, with no change detection in between. See Main-thread scripts.
  • A swiper from touch events — src/app/product-detail/swiper.ts drags the photo strip with [mainThreadCatchtouchmove] and snaps it with a requestAnimationFrame tween. Mouse events are caught too, so it drags in a desktop browser. Catching them, rather than binding, keeps a drag on the photos from reaching the stack outlet, which would take a drag to the right as a swipe back.
  • Two routes in a stack — the gallery and the product page are lazy routes, and the product page reads its :index through withComponentInputBinding(). <lynx-stack-outlet> slides the product page in over the gallery, and the back chevron, Android's back button or a drag to the right slides it away, back to the gallery as you left it. See Slide screens in and out.
  • Bundled images — the pictures are imported, so the build hashes and copies them. See <image>.
  • Safe areas — the nav bar and the Order button pad themselves with env(safe-area-inset-*), so on a phone they clear the status bar and the home indicator. See Safe area.

Where the tutorials differ

Angular runs on the main thread, where the elements are, so the parts of the ReactLynx tutorials that cross threads fall away:

  • The swiper's touch handlers are class properties with the 'main thread' directive. They read the component's fields and write its current signal directly; there's no runOnBackground() to reach state on another thread.
  • A tap on a dot calls the same code the handlers use, without runOnMainThread().
  • The snap's easing is a plain function passed as an input, not a main-thread: prop.