PageReference

An LWR router receives navigation events as page references. Page references are a JSON-format specification of a location. You pass a PageReference object to the router via the navigate API.

Syntax 

1interface PageReference {
2  type: string;
3  attributes: { [key: string]: string | null };
4  state: { [key: string]: string | null };
5}

Properties 

PropertyTypeRequired/OptionalDescription
typestringRequiredAn identifier that’s a user-defined expression.
attributesarrayRequiredAn array of user-defined key-value pairs. If there are no attribute values, set this property to null.
statearrayRequiredAn array of user-defined key-value pairs. If there are no attribute values, set this property to null.

Example 

1// URI
2https://www.somewhere.com/animals/abc?view=compact&dark-mode
3
4// page reference
5{
6    "type": "animal_page",
7    "attributes": {
8        "animalId": "abc"
9    },
10    "state": {
11        "view": "compact",
12        "dark-mode": ""
13    }
14}

See Also

Developer Preview Feature

Feature is available as a developer preview. Feature is not generally available unless or until Salesforce announces its general availability in documentation or in press releases or public statements. All commands, parameters, and other features are subject to change or deprecation at any time, with or without notice. Do not implement functionality developed with these commands or tools.

DID THIS ARTICLE SOLVE YOUR ISSUE?
Let us know so we can improve!