---
schema_version: "1"
id: 7d45405f270a1d0c6dfd7418a950b3e0aa92179c00f54bfc3a68f312c3dc8ed4
title: CurrentPageReference
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/lwr-node/lwr/references/csr-reference/currentpagereference.md
canonical_url: https://developer.salesforce.com/docs/platform/lwr/references/csr-reference/currentpagereference.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 2ebeb634fbc756238af8b660946fdfd47681acf926410a401f89ace09add9d53
products:
  - Lightning Web Runtime
---
# CurrentPageReference

Gets the current page reference from the router container. This wire is also [available in Lightning Experience](https://developer.salesforce.com/docs/platform/lwc/guide/use-navigate-add-params-url.html).

## Properties

None

## Syntax

```javascript
import { LightningElement, wire } from "lwc";
import { CurrentPageReference } from "lightning/navigation";

export default class Example extends LightningElement {
  @wire(CurrentPageReference)
  propertyOrFunction;
}
```

## Returns

- A [`PageReference`](https://developer.salesforce.com/docs/platform/lwr/references/csr-reference/pagereference.md) object containing a reference to the current page.

## Example

```javascript
import { LightningElement, wire } from "lwc";
import { CurrentPageReference } from "lightning/navigation";

export default class Example extends LightningElement {
  // Subscribe to page reference updates
  @wire(CurrentPageReference)
  printPageName(pageRef) {
    console.log(`Page name: ${pageRef ? pageRef.attributes.name : ""}`);
  }
}
```
