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 /api/angular-lynx/device/system-info.md.

LynxSystemInfo

Device and platform facts, such as the screen size and the operating system. import { LynxSystemInfo } from '@blotch/angular-lynx';

Usage

src/app/device.ts
import { Component, inject } from '@angular/core';
import { LYNX_ELEMENTS, LynxSystemInfo } from '@blotch/angular-lynx';

@Component({
  selector: 'app-device',
  imports: [LYNX_ELEMENTS],
  template: `
    <text>{{ info.platform }} {{ info.osVersion }}</text>
    <text>{{ info.screenWidth }} × {{ info.screenHeight }}</text>
  `,
})
export class Device {
  readonly info = inject(LynxSystemInfo);
}

API

LynxSystemInfo

@Injectable({ providedIn: 'root' })
class LynxSystemInfo {}

Reads Lynx's global SystemInfo. Lynx fills it in once when the page starts, so the values never change and aren't signals. osVersion is the exception, below.

  • Creating it throws outside Lynx, such as in unit tests.

LynxSystemInfo.platform

get platform(): PlatformType;

The platform, such as 'iOS', 'Android' or 'web'. See PlatformType for every value.

LynxSystemInfo.osVersion

get osVersion(): string;

The operating system's version, such as '26.1' on iOS or '15' on Android. Empty while it isn't known.

  • On iOS and Android, Lynx leaves it out of the SystemInfo your components see, so it comes from elsewhere. The apps ng build --platform makes send it as the osVersion global prop. Your own native app can send it the same way.
  • Without the global prop, it's asked of the background thread, which has it, and arrives shortly after the first frame. Reading it in a computed() picks the answer up.

LynxSystemInfo.engineVersion

get engineVersion(): string;

The Lynx engine's version, such as '3.2'.

LynxSystemInfo.pixelWidth and pixelHeight

get pixelWidth(): number;
get pixelHeight(): number;

The screen's size in physical pixels.

LynxSystemInfo.pixelRatio

get pixelRatio(): number;

Physical pixels per CSS pixel.

LynxSystemInfo.screenWidth and screenHeight

get screenWidth(): number;
get screenHeight(): number;

The screen's size in CSS pixels: the physical size divided by pixelRatio.

  • It's the size when the page started. It doesn't follow a phone folding or unfolding, a rotation or split screen. For a size that does, as signals, use LynxViewport.

LynxSystemInfo.runtimeType

get runtimeType(): 'v8' | 'jsc' | 'quickjs';

The JavaScript engine that runs the background thread. Lynx sets it only on that thread.

LynxSystemInfo.theme

get theme(): object | undefined;

A theme object, if the host app provides one. For light or dark mode, use LynxTheme.

Types

PlatformType

import type { PlatformType } from '@blotch/angular-lynx';

type PlatformType = 'Android' | 'iOS' | 'Harmony' | 'windows' | 'macOS' | 'web';

The platform, spelled exactly as Lynx reports it. Compare with the strings as written: 'iOS' matches, 'ios' never does.

  • The casing is Lynx's. Each platform names itself, so 'windows' is lower case and 'macOS' isn't.
  • 'web' is the web preview. @lynx-js/types' own PlatformType leaves it out.
  • 'pc' isn't a value. @lynx-js/types still lists it: desktop Lynx reported it before Lynx 3.3, and no supported version does.